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

C={}
S1=[]
for i in range(n):
    a,b = map(int,input().split())
    S1.append(a)
    if a in C:
        C[a]+=b
    else:
        C[a]=b
S=list(set(S1))
S.sort()

ans=0
for s in S:
    # print(S,C,ans)
    if m<C[s] :
        ans+=m*s
        break
    else:
        ans+=C[s]*s
        m-=C[s]

print(ans)

 n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m C={} C {} S1=[] S1 [] for i in range(n):
    a,b = map(int,input().split())
    S1.append(a)
    if a in C:
        C[a]+=b
    else:
        C[a]=b i range(n) range n a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b S1.append(a) S1.append S1 append a if a in C:
        C[a]+=b
    else:
        C[a]=b a in C a C C[a]+=b C[a] C a b C[a]=b C[a] C a b S=list(set(S1)) S list(set(S1)) list set(S1) set S1 S.sort() S.sort S sort ans=0 ans 0 for s in S:
    # print(S,C,ans)
    if m<C[s] :
        ans+=m*s
        break
    else:
        ans+=C[s]*s
        m-=C[s] s S if m<C[s] :
        ans+=m*s
        break
    else:
        ans+=C[s]*s
        m-=C[s] m<C[s] m C[s] C s ans+=m*s ans m*s m s break ans+=C[s]*s ans C[s]*s C[s] C s s m-=C[s] m C[s] C s print(ans) print ans S1=[] [] S1 ans+=C[s]*s C[s]*s ans C={} {} C n,m = map(int,input().split()) map(int,input().split()) n ans+=m*s m*s ans a,b = map(int,input().split()) map(int,input().split()) a m-=C[s] C[s] m S=list(set(S1)) list(set(S1)) S ans=0 0 ans m = map(int,input().split()) map(int,input().split()) m b = map(int,input().split()) map(int,input().split()) b
n,m = map(int,input().split())

C={}
S1=[]
for i in range(n):
    a,b = map(int,input().split())
    S1.append(a)
    if a in C:
        C[a]+=b
    else:
        C[a]=b
S=list(set(S1))
S.sort()

ans=0
for s in S:
    # print(S,C,ans)
    if m<C[s] :
        ans+=m*s
        break
    else:
        ans+=C[s]*s
        m-=C[s]

print(ans)


