n,m = map(int,input().split())
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
cnt = 0
a = sorted(a, key=lambda x:x[0])
for i in range(n):
    if cnt + a[i][1] <m:
        ans += a[i][0]*a[i][1]
        cnt +=a[i][1]
    else:
        ans += a[i][0]*(m-cnt)
        break
print(ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a = [list(map(int, input().split())) for _ in range(n)] a [list(map(int, input().split())) for _ in range(n)] ans = 0 ans 0 cnt = 0 cnt 0 a = sorted(a, key=lambda x:x[0]) a sorted(a, key=lambda x:x[0]) sorted a key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in range(n):
    if cnt + a[i][1] <m:
        ans += a[i][0]*a[i][1]
        cnt +=a[i][1]
    else:
        ans += a[i][0]*(m-cnt)
        break i range(n) range n if cnt + a[i][1] <m:
        ans += a[i][0]*a[i][1]
        cnt +=a[i][1]
    else:
        ans += a[i][0]*(m-cnt)
        break cnt + a[i][1] <m cnt + a[i][1] cnt a[i][1] [i] a i 1 m ans += a[i][0]*a[i][1] ans a[i][0]*a[i][1] a[i][0] [i] a i 0 a[i][1] [i] a i 1 cnt +=a[i][1] cnt a[i][1] [i] a i 1 ans += a[i][0]*(m-cnt) ans a[i][0]*(m-cnt) a[i][0] [i] a i 0 m-cnt m cnt break print(ans) print ans n,m = map(int,input().split()) map(int,input().split()) n cnt +=a[i][1] a[i][1] cnt m = map(int,input().split()) map(int,input().split()) m ans += a[i][0]*a[i][1] a[i][0]*a[i][1] ans a = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] a cnt = 0 0 cnt ans += a[i][0]*(m-cnt) a[i][0]*(m-cnt) ans a = sorted(a, key=lambda x:x[0]) sorted(a, key=lambda x:x[0]) a ans = 0 0 ans
n,m = map(int,input().split())
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
cnt = 0
a = sorted(a, key=lambda x:x[0])
for i in range(n):
    if cnt + a[i][1] <m:
        ans += a[i][0]*a[i][1]
        cnt +=a[i][1]
    else:
        ans += a[i][0]*(m-cnt)
        break
print(ans)