'use strict'

function main(input) {
  input = input.split('\n').map(v => v.split(' ').map(v => ~~v))

  const n = input[0][0] //shop.length
  const m = input[0][1] //M 本の栄養ドリンクを買い集める
  const shop = input.slice(1, -1) // 単価 + max
  shop.sort((a, b) => {
    return a[0] - b[0]
  })
  let cost = 0
  let total = 0

  for (let i in shop) {
    cost = cost + shop[i][0] * shop[i][1]
    total = total + shop[i][1]

    if (total == m) {
      console.log(cost)
      return
    } else if (total > m) {
      let sa = total - m
      cost -= sa * shop[i][0]
      console.log(cost)
      return
    } 
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
