program factory(input,output); // gao jing du(X) int64 ke yi jie jue wen ti ;
var
i,j,k:longint;
n:longint;
s:longint;
min,now:longint;
c:array [1..10000] of integer;
y:array [1..10000] of integer;
ans:int64;
begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input);
rewrite(output);
readln(n,s);
for i:=1 to n do
readln(c[i],y[i]);
ans:=c[1]*y[1];
for i:=2 to n do begin
min:=maxlongint;
for j:=1 to i do
begin
now:=(c[j]+(i-j)*s);
if (now<min) then min:=now;
end;
ans:=ans+min*y[i];
end;
writeln(ans);
close(input);
close(output);
end.