# ABC 121 C



N, M = list(map(int, input().split()))



arr = []



for i in range(N):

    arr.append(list(map(int, input().split())))



arr.sort()



sum = 0



for i in range(N):

    if arr[i][1] < M:

        sum += arr[i][0] * arr[i][1]

        M -= arr[i][1]

    else:

        sum += arr[i][0] * M

        break



print(sum)

def resolve():

  n, m = list(map(int, input().split()))

  l = []

  for i in range(n):

    a, b = list(map(int, input().split()))

    l.append([a, b])

  l.sort()

  ans = 0

  for ab in l:

    if ab[1] < m:

      m -= ab[1]

      ans += ab[0] * ab[1]

    else:

      ans += ab[0] * m

      m = 0

      break

  print(ans)

  return



if __name__ == "__main__":

  resolve()

# ABC 121 C
N, M = list(map(int, input().split()))
arr = []
for i in range(N):
    arr.append(list(map(int, input().split())))
arr.sort()
sum = 0
for i in range(N):
    if arr[i][1] < M:
        sum += arr[i][0] * arr[i][1]
        M -= arr[i][1]
    else:
        sum += arr[i][0] * M
        break
print(sum)

def resolve():
    n, m = list(map(int, input().split()))
    l = []
    for i in range(n):
        a, b = list(map(int, input().split()))
        l.append([a, b])
    l.sort()
    ans = 0
    for ab in l:
        if ab[1] < m:
            m -= ab[1]
            ans += ab[0] * ab[1]
        else:
            ans += ab[0] * m
            m = 0
            break
    print(ans)
    return


if __name__ == "__main__":
    resolve()

-# ABC 121 C -N, M = list(map(int, input().split())) -arr = [] -for i in range(N): -    arr.append(list(map(int, input().split()))) -arr.sort() -sum = 0 -for i in range(N): -    if arr[i][1] < M: -        sum += arr[i][0] * arr[i][1] -        M -= arr[i][1] -    else: -        sum += arr[i][0] * M -        break -print(sum) +def resolve(): +    n, m = list(map(int, input().split())) +    l = [] +    for i in range(n): +        a, b = list(map(int, input().split())) +        l.append([a, b]) +    l.sort() +    ans = 0 +    for ab in l: +        if ab[1] < m: +            m -= ab[1] +            ans += ab[0] * ab[1] +        else: +            ans += ab[0] * m +            m = 0 +            break +    print(ans) +    return + + +if __name__ == "__main__": +    resolve()