program factory;
var
a:array[1..2,1..10000] of int64;
i,n,m,k:longint;
min:int64;
Begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input); rewrite(output);
readln(n,m); min:=0; k:=1;
for i:=1 to n do begin
readln(a[1,i],a[2,i]);
if a[1,i]<=a[1,k] then k:=i;
min:=min+(a[1,k]*a[2,i]);
a[1,k]:=a[1,k]+m;
end;
writeln(min);
close(input); close(output);
End.