import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,m = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(n)]

s = 0
for i in sorted(li):
    if i[1] <= m:
        m -= i[1]
        s += i[0] * i[1]
    else:
        s += i[0] * m
        break
print(s) import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 li = [list(map(int, input().split())) for _ in range(n)] li [list(map(int, input().split())) for _ in range(n)] s = 0 s 0 for i in sorted(li):
    if i[1] <= m:
        m -= i[1]
        s += i[0] * i[1]
    else:
        s += i[0] * m
        break i sorted(li) sorted li if i[1] <= m:
        m -= i[1]
        s += i[0] * i[1]
    else:
        s += i[0] * m
        break i[1] <= m i[1] i 1 m m -= i[1] m i[1] i 1 s += i[0] * i[1] s i[0] * i[1] i[0] i 0 i[1] i 1 s += i[0] * m s i[0] * m i[0] i 0 m break print(s) print s s += i[0] * i[1] i[0] * i[1] s input = sys.stdin.readline sys.stdin.readline input m = map(int, input().split()) map(int, input().split()) m m -= i[1] i[1] m s = 0 0 s n,m = map(int, input().split()) map(int, input().split()) n s += i[0] * m i[0] * m s li = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] li
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,m = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(n)]

s = 0
for i in sorted(li):
    if i[1] <= m:
        m -= i[1]
        s += i[0] * i[1]
    else:
        s += i[0] * m
        break
print(s)
