program bly(input,output);
var
a,b:array[1..10000] of integer;
f:array[1..10000] of int64;
n,s:integer;
ans,s0:int64;
i,j:integer;
f1,f2:text;
function min(x,y:int64):int64;
begin
if x>y then min:=y
else min:=x;
end;
begin
assign(f1,'factory.in');
reset(f1);
readln(f1,n,s);
for i:=1 to n do readln(f1,a[i],b[i]);
close(f1);
for i:=1 to n do begin
f[i]:=a[1]+s0;
s0:=s0+s;
end;
for i:=2 to n do begin
s0:=0;
for j:=i to n do begin
f[j]:=min(f[j],a[i]+s0);
s0:=s0+s;
end;
end;
ans:=0;
for i:=1 to n do begin
ans:=ans+f[i]*b[i];
end;
assign(f2,'factory.out');
rewrite(f2);
writeln(f2,ans);
close(f2);
end.