program p1;
const
maxn=10000;
var
a,y:array[1..maxn] of longint;
n,s,i,j,tm,min:longint;
ans:int64;
begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input); rewrite(output);
readln(n,s);
for i:=1 to n do read(a[i],y[i]);
ans:=a[1]*y[1];
for i:=2 to n do
begin
min:=maxlongint;
for j:=1 to i-1 do
begin
tm:=a[j]+(i-j)*s;
if tm<min then min:=tm;
end;
if min<a[i] then inc(ans,min*y[i]) else inc(ans,a[i]*y[i]);
end;
writeln(ans);
close(input); close(output);
end.