# coding: utf-8



# import sys

# input = sys.stdin.readline



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



AB = [list(map(int, input().split())) for __ in range(N)]

AB.sort(key=lambda x : x[0])



k = 0

ans = 0

while M > 0:

    if M > AB[k][1]:

        M -= AB[k][1]

        ans += AB[k][0] * AB[k][1]

    else:

        ans += AB[k][0] * M

        break

    

    k += 1



print(ans)



# coding: utf-8



import sys

input = sys.stdin.readline



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



AB = [list(map(int, input().split())) for __ in range(N)]

AB.sort(key=lambda x : x[0])



k = 0

ans = 0

while M > 0:

    if M > AB[k][1]:

        M -= AB[k][1]

        ans += AB[k][0] * AB[k][1]

    else:

        ans += AB[k][0] * M

        break

    

    k += 1



print(ans)



# coding: utf-8
# import sys
# input = sys.stdin.readline
N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for __ in range(N)]
AB.sort(key=lambda x: x[0])
k = 0
ans = 0
while M > 0:
    if M > AB[k][1]:
        M -= AB[k][1]
        ans += AB[k][0] * AB[k][1]
    else:
        ans += AB[k][0] * M
        break
    k += 1
print(ans)

# coding: utf-8
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for __ in range(N)]
AB.sort(key=lambda x: x[0])
k = 0
ans = 0
while M > 0:
    if M > AB[k][1]:
        M -= AB[k][1]
        ans += AB[k][0] * AB[k][1]
    else:
        ans += AB[k][0] * M
        break
    k += 1
print(ans)

-# import sys -# input = sys.stdin.readline +import sys + +input = sys.stdin.readline