def main():

    n, m = list(map(int, input().split()))



    ab = [list(map(int, input().split())) for _ in range(n)]

    ab.sort()

    ans = 0



    for i, j in ab:

        if m < j:

            ans += i*m

            break

        m -= j

        ans += i*j

        



    print(ans)



main()
def main():

    n, m = list(map(int, input().split()))



    ab = [tuple(map(int, input().split())) for _ in range(n)]

    ab.sort()

    ans = 0



    for i, j in ab:

        if m < j:

            ans += i*m

            break

        m -= j

        ans += i*j

        



    print(ans)



main()
def main():
    n, m = list(map(int, input().split()))
    ab = [list(map(int, input().split())) for _ in range(n)]
    ab.sort()
    ans = 0
    for i, j in ab:
        if m < j:
            ans += i * m
            break
        m -= j
        ans += i * j
    print(ans)


main()

def main():
    n, m = list(map(int, input().split()))
    ab = [tuple(map(int, input().split())) for _ in range(n)]
    ab.sort()
    ans = 0
    for i, j in ab:
        if m < j:
            ans += i * m
            break
        m -= j
        ans += i * j
    print(ans)


main()

-    ab = [list(map(int, input().split())) for _ in range(n)] +    ab = [tuple(map(int, input().split())) for _ in range(n)]