program waterfire;
const
fin='factory.in';
fout='factory.out';
var
i,j,n,s,t:longint;
max:int64;
data,cost:array[0..10000] of longint;
f1,f2:text;
Procedure work(x:longint);
var
ii,jj:longint;
Begin
for ii:=x to n do
if data[x]*cost[ii]+(ii-x)*s*cost[ii]<=data[ii]*cost[ii]
then
begin
max:=max+data[x]*cost[ii]+(ii-x)*s*cost[ii];
if ii=n then begin
writeln(f2,max);
close(f2);
halt;
end;
end else work(ii);
End;
BEGIN
max:=0;
assign(f1,fin);reset(f1);
assign(f2,fout);rewrite(f2);
readln(f1,n,s);
for i:=1 to n do
readln(f1,data[i],cost[i]);
close(f1);
work(1);
writeln(max);
END.