#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n,m,*t=map(int,open(0).read().split());c=0\n"
"for a,b in sorted(zip(t[::2],t[1::2])):c+=a*min(m,b);m=max(0,m-b)\n"
"print(c)\n"
"\"";
  system(s);
  return 0;
}            