N, M = (int(x) for x in input().split())
L = []
for i in range(N):
  A, B = (int(x) for x in input().split())
  L.append((A,B))
L.sort()
tn = 0
tm = 0
for i in range(N):
  if L[i][1] < M-tn:
    tn += L[i][1]
    tm += L[i][0]*L[i][1]
  else:
    tm += L[i][0]*(M-tn)
    print(tm)
    quit() int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x N, M = (int(x) for x in input().split()) N (int(x) for x in input().split()) M L = [] L [] for i in range(N):
  A, B = (int(x) for x in input().split())
  L.append((A,B)) i range(N) range N int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A, B = (int(x) for x in input().split()) A (int(x) for x in input().split()) B L.append((A,B)) L.append L append (A,B) A B L.sort() L.sort L sort tn = 0 tn 0 tm = 0 tm 0 for i in range(N):
  if L[i][1] < M-tn:
    tn += L[i][1]
    tm += L[i][0]*L[i][1]
  else:
    tm += L[i][0]*(M-tn)
    print(tm)
    quit() i range(N) range N if L[i][1] < M-tn:
    tn += L[i][1]
    tm += L[i][0]*L[i][1]
  else:
    tm += L[i][0]*(M-tn)
    print(tm)
    quit() L[i][1] < M-tn L[i][1] [i] L i 1 M-tn M tn tn += L[i][1] tn L[i][1] [i] L i 1 tm += L[i][0]*L[i][1] tm L[i][0]*L[i][1] L[i][0] [i] L i 0 L[i][1] [i] L i 1 tm += L[i][0]*(M-tn) tm L[i][0]*(M-tn) L[i][0] [i] L i 0 M-tn M tn print(tm) print tm quit() quit tn = 0 0 tn B = (int(x) for x in input().split()) (int(x) for x in input().split()) B tm += L[i][0]*(M-tn) L[i][0]*(M-tn) tm tn += L[i][1] L[i][1] tn N, M = (int(x) for x in input().split()) (int(x) for x in input().split()) N tm = 0 0 tm tm += L[i][0]*L[i][1] L[i][0]*L[i][1] tm L = [] [] L M = (int(x) for x in input().split()) (int(x) for x in input().split()) M A, B = (int(x) for x in input().split()) (int(x) for x in input().split()) A
N, M = (int(x) for x in input().split())
L = []
for i in range(N):
  A, B = (int(x) for x in input().split())
  L.append((A,B))
L.sort()
tn = 0
tm = 0
for i in range(N):
  if L[i][1] < M-tn:
    tn += L[i][1]
    tm += L[i][0]*L[i][1]
  else:
    tm += L[i][0]*(M-tn)
    print(tm)
    quit()