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

ans = 0

for i in range(N):
  if M - E[i][1] >= 0:
    ans += E[i][0] * E[i][1]
    M -= E[i][1]
  else:
    ans += E[i][0] * M
    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 _ 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 E = [list(map(int, input().split())) for _ in range(N)] E [list(map(int, input().split())) for _ in range(N)] E.sort() E.sort E sort ans = 0 ans 0 for i in range(N):
  if M - E[i][1] >= 0:
    ans += E[i][0] * E[i][1]
    M -= E[i][1]
  else:
    ans += E[i][0] * M
    break i range(N) range N if M - E[i][1] >= 0:
    ans += E[i][0] * E[i][1]
    M -= E[i][1]
  else:
    ans += E[i][0] * M
    break M - E[i][1] >= 0 M - E[i][1] M E[i][1] [i] E i 1 0 ans += E[i][0] * E[i][1] ans E[i][0] * E[i][1] E[i][0] [i] E i 0 E[i][1] [i] E i 1 M -= E[i][1] M E[i][1] [i] E i 1 ans += E[i][0] * M ans E[i][0] * M E[i][0] [i] E i 0 M break print(ans) print ans ans += E[i][0] * E[i][1] E[i][0] * E[i][1] ans M = map(int, input().split()) map(int, input().split()) M ans = 0 0 ans M -= E[i][1] E[i][1] M N, M = map(int, input().split()) map(int, input().split()) N ans += E[i][0] * M E[i][0] * M ans E = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] E
N, M = map(int, input().split())
E = [list(map(int, input().split())) for _ in range(N)]
E.sort()

ans = 0

for i in range(N):
  if M - E[i][1] >= 0:
    ans += E[i][0] * E[i][1]
    M -= E[i][1]
  else:
    ans += E[i][0] * M
    break

print(ans)