n,m=map(int,input().split())
d={}
A=[0]*n
B=[0]*n
for i in range(n):
    A[i],B[i]=map(int,input().split())
    d[str(i)]=A[i]
a=sorted(d.items(),key=lambda x:x[1])
ans=0
for i in range(n):
    if m>B[int(a[i][0])]:
        m-=B[int(a[i][0])]
        ans+=a[i][1]*B[int(a[i][0])]
    else:
        ans+=a[i][1]*m
        break
print(ans) n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m d={} d {} A=[0]*n A [0]*n [0] 0 n B=[0]*n B [0]*n [0] 0 n for i in range(n):
    A[i],B[i]=map(int,input().split())
    d[str(i)]=A[i] i range(n) range n A[i],B[i]=map(int,input().split()) A[i] A i map(int,input().split()) map int input().split() ().split () input split B[i] B i d[str(i)]=A[i] d[str(i)] d str(i) str i A[i] A i a=sorted(d.items(),key=lambda x:x[1]) a sorted(d.items(),key=lambda x:x[1]) sorted d.items() d.items d items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x ans=0 ans 0 for i in range(n):
    if m>B[int(a[i][0])]:
        m-=B[int(a[i][0])]
        ans+=a[i][1]*B[int(a[i][0])]
    else:
        ans+=a[i][1]*m
        break i range(n) range n if m>B[int(a[i][0])]:
        m-=B[int(a[i][0])]
        ans+=a[i][1]*B[int(a[i][0])]
    else:
        ans+=a[i][1]*m
        break m>B[int(a[i][0])] m B[int(a[i][0])] B int(a[i][0]) int a[i][0] [i] a i 0 m-=B[int(a[i][0])] m B[int(a[i][0])] B int(a[i][0]) int a[i][0] [i] a i 0 ans+=a[i][1]*B[int(a[i][0])] ans a[i][1]*B[int(a[i][0])] a[i][1] [i] a i 1 B[int(a[i][0])] B int(a[i][0]) int a[i][0] [i] a i 0 ans+=a[i][1]*m ans a[i][1]*m a[i][1] [i] a i 1 m break print(ans) print ans n,m=map(int,input().split()) map(int,input().split()) n d={} {} d m-=B[int(a[i][0])] B[int(a[i][0])] m ans+=a[i][1]*m a[i][1]*m ans ans=0 0 ans ans+=a[i][1]*B[int(a[i][0])] a[i][1]*B[int(a[i][0])] ans A=[0]*n [0]*n A B=[0]*n [0]*n B a=sorted(d.items(),key=lambda x:x[1]) sorted(d.items(),key=lambda x:x[1]) a m=map(int,input().split()) map(int,input().split()) m
n,m=map(int,input().split())
d={}
A=[0]*n
B=[0]*n
for i in range(n):
    A[i],B[i]=map(int,input().split())
    d[str(i)]=A[i]
a=sorted(d.items(),key=lambda x:x[1])
ans=0
for i in range(n):
    if m>B[int(a[i][0])]:
        m-=B[int(a[i][0])]
        ans+=a[i][1]*B[int(a[i][0])]
    else:
        ans+=a[i][1]*m
        break
print(ans)