import numpy as np

def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money)

if __name__ == "__main__":
    N,M = list(map(int, input().split()))   
    AB = [list(map(int, input().split())) for _ in range(N)]
    AB.sort(key=lambda x: x[0])
#    print(AB)
    solve() import numpy as np numpy def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money) solve cnt = 0 cnt 0 money = 0 money 0 for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
     i range(N) range N if cnt >= M:
            break
         cnt >= M cnt M break if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
     cnt + AB[i][1] >= M cnt + AB[i][1] cnt AB[i][1] [i] AB i 1 M money += AB[i][0] * (M - cnt) money AB[i][0] * (M - cnt) AB[i][0] [i] AB i 0 M - cnt M cnt cnt = M cnt M money += AB[i][0]*AB[i][1] money AB[i][0]*AB[i][1] AB[i][0] [i] AB i 0 AB[i][1] [i] AB i 1 cnt += AB[i][1] cnt AB[i][1] [i] AB i 1 print(money) print money if __name__ == "__main__":
    N,M = list(map(int, input().split()))   
    AB = [list(map(int, input().split())) for _ in range(N)]
    AB.sort(key=lambda x: x[0])
#    print(AB)
    solve() __name__ == "__main__" __name__ "__main__" N,M = list(map(int, input().split())) N list(map(int, input().split())) list 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 AB = [list(map(int, input().split())) for _ in range(N)] AB [list(map(int, input().split())) for _ in range(N)] AB.sort(key=lambda x: x[0]) AB.sort AB sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x solve() solve N,M = list(map(int, input().split())) list(map(int, input().split())) N AB = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] AB def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money) def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money) solve M = list(map(int, input().split())) list(map(int, input().split())) M
import numpy as np

def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money)

if __name__ == "__main__":
    N,M = list(map(int, input().split()))   
    AB = [list(map(int, input().split())) for _ in range(N)]
    AB.sort(key=lambda x: x[0])
#    print(AB)
    solve()
