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