n,m = map(int,input().split())
a_b = {}
for i in range(n):
    x,y = map(int,input().split())
    if x in a_b.keys():
        a_b[x] += y
        continue
    a_b[x] = y
a_b = sorted(a_b.items(), key=lambda x:x[0])

#print(a_b)
c = 0
ans = 0
t = 0
for i in range(int(len(a_b))):
    c += a_b[i][1]
    if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1]

print(ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m a_b = {} a_b {} for i in range(n):
    x,y = map(int,input().split())
    if x in a_b.keys():
        a_b[x] += y
        continue
    a_b[x] = y i range(n) range n x,y = map(int,input().split()) x map(int,input().split()) map int input().split() ().split () input split y if x in a_b.keys():
        a_b[x] += y
        continue
     x in a_b.keys() x a_b.keys() a_b.keys a_b keys a_b[x] += y a_b[x] a_b x y continue a_b[x] = y a_b[x] a_b x y a_b = sorted(a_b.items(), key=lambda x:x[0]) a_b sorted(a_b.items(), key=lambda x:x[0]) sorted a_b.items() a_b.items a_b items key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x c = 0 c 0 ans = 0 ans 0 t = 0 t 0 for i in range(int(len(a_b))):
    c += a_b[i][1]
    if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1] i range(int(len(a_b))) range int(len(a_b)) int len(a_b) len a_b c += a_b[i][1] c a_b[i][1] [i] a_b i 1 if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1] c > m c m ans += a_b[i][0] * (m - t) ans a_b[i][0] * (m - t) a_b[i][0] [i] a_b i 0 m - t m t break ans += a_b[i][0] * a_b[i][1] ans a_b[i][0] * a_b[i][1] a_b[i][0] [i] a_b i 0 a_b[i][1] [i] a_b i 1 t += a_b[i][1] t a_b[i][1] [i] a_b i 1 print(ans) print ans m = map(int,input().split()) map(int,input().split()) m x,y = map(int,input().split()) map(int,input().split()) x ans = 0 0 ans t += a_b[i][1] a_b[i][1] t ans += a_b[i][0] * a_b[i][1] a_b[i][0] * a_b[i][1] ans c += a_b[i][1] a_b[i][1] c y = map(int,input().split()) map(int,input().split()) y a_b = sorted(a_b.items(), key=lambda x:x[0]) sorted(a_b.items(), key=lambda x:x[0]) a_b a_b = {} {} a_b ans += a_b[i][0] * (m - t) a_b[i][0] * (m - t) ans c = 0 0 c t = 0 0 t n,m = map(int,input().split()) map(int,input().split()) n
n,m = map(int,input().split())
a_b = {}
for i in range(n):
    x,y = map(int,input().split())
    if x in a_b.keys():
        a_b[x] += y
        continue
    a_b[x] = y
a_b = sorted(a_b.items(), key=lambda x:x[0])

#print(a_b)
c = 0
ans = 0
t = 0
for i in range(int(len(a_b))):
    c += a_b[i][1]
    if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1]

print(ans)
