program df;
var
f1,f2:text;
a:int64;
c:array[1..10000]of integer;
v:array[1..10000]of integer;
n,s,k,i,j:integer;
function min(i:integer):integer;
var
j:integer;
begin
min:=maxint;
for j:= 1to i do
if c[j]+s*(i-j)<min then min:=c[j]+s*(i-j);
end;
begin
assign(f1,'factory.in');
assign(f2,'factory.out');
reset(f1);
rewrite(f2);
readln(f1,n,s);
for i:= 1to n do readln(f1,c[i],v[i]);
for i:= 1to n do begin
k:=min(i);
a:=a+v[i]*k;
end;
writeln(f2,a);
close(f1);
close(f2);
end.