
N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

X.sort()
res = M
ans = 0
for a, b in X:
    if res <= 0:
        break

    tmp = min(b, res)
    res -= tmp
    ans += tmp * a

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 X = [list(map(int, input().split())) for _ in range(N)] X [list(map(int, input().split())) for _ in range(N)] X.sort() X.sort X sort res = M res M ans = 0 ans 0 for a, b in X:
    if res <= 0:
        break

    tmp = min(b, res)
    res -= tmp
    ans += tmp * a a b X if res <= 0:
        break

     res <= 0 res 0 break tmp = min(b, res) tmp min(b, res) min b res res -= tmp res tmp ans += tmp * a ans tmp * a tmp a print(ans) print ans tmp = min(b, res) min(b, res) tmp N, M = map(int, input().split()) map(int, input().split()) N ans = 0 0 ans ans += tmp * a tmp * a ans res = M M res res -= tmp tmp res X = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] X M = map(int, input().split()) map(int, input().split()) M

N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

X.sort()
res = M
ans = 0
for a, b in X:
    if res <= 0:
        break

    tmp = min(b, res)
    res -= tmp
    ans += tmp * a

print(ans)
