N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
AB_soretd = sorted(AB, key=lambda a: a[0])
drink_cnt = 0
ans = 0
for i in range(N):
    a = AB_soretd[i][0]
    b = AB_soretd[i][1]
    if M > drink_cnt + b:
        ans += a * b
        drink_cnt += b
    else:
        for i in range(1,b+1):
            if M == drink_cnt + i:
                ans += a * i
                break
        break
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 i in range(N) for i in range(N) i range(N) range N for i 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 i in range(N)] AB [list(map(int, input().split())) for i in range(N)] AB_soretd = sorted(AB, key=lambda a: a[0]) AB_soretd sorted(AB, key=lambda a: a[0]) sorted AB key=lambda a: a[0] key lambda a: a[0] a[0] a 0 a drink_cnt = 0 drink_cnt 0 ans = 0 ans 0 for i in range(N):
    a = AB_soretd[i][0]
    b = AB_soretd[i][1]
    if M > drink_cnt + b:
        ans += a * b
        drink_cnt += b
    else:
        for i in range(1,b+1):
            if M == drink_cnt + i:
                ans += a * i
                break
        break i range(N) range N a = AB_soretd[i][0] a AB_soretd[i][0] [i] AB_soretd i 0 b = AB_soretd[i][1] b AB_soretd[i][1] [i] AB_soretd i 1 if M > drink_cnt + b:
        ans += a * b
        drink_cnt += b
    else:
        for i in range(1,b+1):
            if M == drink_cnt + i:
                ans += a * i
                break
        break M > drink_cnt + b M drink_cnt + b drink_cnt b ans += a * b ans a * b a b drink_cnt += b drink_cnt b for i in range(1,b+1):
            if M == drink_cnt + i:
                ans += a * i
                break
         i range(1,b+1) range 1 b+1 b 1 if M == drink_cnt + i:
                ans += a * i
                break
         M == drink_cnt + i M drink_cnt + i drink_cnt i ans += a * i ans a * i a i break break print(ans) print ans ans = 0 0 ans drink_cnt = 0 0 drink_cnt AB = [list(map(int, input().split())) for i in range(N)] [list(map(int, input().split())) for i in range(N)] AB a = AB_soretd[i][0] AB_soretd[i][0] a N, M = map(int, input().split()) map(int, input().split()) N ans += a * i a * i ans ans += a * b a * b ans drink_cnt += b b drink_cnt M = map(int, input().split()) map(int, input().split()) M b = AB_soretd[i][1] AB_soretd[i][1] b AB_soretd = sorted(AB, key=lambda a: a[0]) sorted(AB, key=lambda a: a[0]) AB_soretd
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
AB_soretd = sorted(AB, key=lambda a: a[0])
drink_cnt = 0
ans = 0
for i in range(N):
    a = AB_soretd[i][0]
    b = AB_soretd[i][1]
    if M > drink_cnt + b:
        ans += a * b
        drink_cnt += b
    else:
        for i in range(1,b+1):
            if M == drink_cnt + i:
                ans += a * i
                break
        break
print(ans)


