from sys import stdin

from operator import itemgetter



input = stdin.readline



N, M = list(map(int, input().split()))



AB = [[int(j) for j in input().split()] for i in range(N)]





def main():

    AB.sort(key=itemgetter(0))

    num = 0

    yen = 0

    for i in range(N):

        if M < num + AB[i][1]:

            yen += AB[i][0] * (M - num)

            break

        else:

            yen += AB[i][0] * AB[i][1]

            num += AB[i][1]

    print(yen)

    return





main()

from sys import stdin



N, M = list(map(int, input().split()))

*AB, = list(map(int, stdin.read().split()))





def main():

    A = AB[::2]

    B = AB[1::2]

    Z = list(zip(A, B))

    Z = sorted(Z)

    num = 0

    yen = 0

    for a, b in Z:

        if M < num + b:

            yen += a * (M - num)

            break

        else:

            yen += a * b

            num += b

    print(yen)

    return





main()

from sys import stdin
from operator import itemgetter

input = stdin.readline
N, M = list(map(int, input().split()))
AB = [[int(j) for j in input().split()] for i in range(N)]


def main():
    AB.sort(key=itemgetter(0))
    num = 0
    yen = 0
    for i in range(N):
        if M < num + AB[i][1]:
            yen += AB[i][0] * (M - num)
            break
        else:
            yen += AB[i][0] * AB[i][1]
            num += AB[i][1]
    print(yen)
    return


main()

from sys import stdin

N, M = list(map(int, input().split()))
(*AB,) = list(map(int, stdin.read().split()))


def main():
    A = AB[::2]
    B = AB[1::2]
    Z = list(zip(A, B))
    Z = sorted(Z)
    num = 0
    yen = 0
    for a, b in Z:
        if M < num + b:
            yen += a * (M - num)
            break
        else:
            yen += a * b
            num += b
    print(yen)
    return


main()

-from operator import itemgetter -input = stdin.readline -AB = [[int(j) for j in input().split()] for i in range(N)] +(*AB,) = list(map(int, stdin.read().split())) -    AB.sort(key=itemgetter(0)) +    A = AB[::2] +    B = AB[1::2] +    Z = list(zip(A, B)) +    Z = sorted(Z) -    for i in range(N): -        if M < num + AB[i][1]: -            yen += AB[i][0] * (M - num) +    for a, b in Z: +        if M < num + b: +            yen += a * (M - num) -            yen += AB[i][0] * AB[i][1] -            num += AB[i][1] +            yen += a * b +            num += b