let rec sort lst =
  match lst with
  | [] -> []
  | (x, y) :: tail -> insert (x, y) (sort tail)
and insert (x, y) lst =
  match lst with
  | [] -> [(x, y)]
  | (x2, y2) :: tail ->
    if x <= x2 then (x, y) :: lst else (x2, y2) :: insert (x, y) tail
let rec buy m lst = match lst with
  | [] -> 0
  | (x, y) :: tail ->
    if m <= y then x * m
    else x * y + buy (m-y) tail
let () =
  let (n, m) = Scanf.scanf "%d %d\n" (fun x y -> (x, y)) in
  let lst = sort (Array.to_list (Array.init n (fun _ -> Scanf.scanf "%d %d\n" (fun x y -> (x, y))))) in
  Printf.printf "%d\n" (buy m lst)