program factory(input,output);
var
week:array[1..10000]of int64;
cost,need:array[1..10000]of integer;
n,s,i,j:integer;
tot:int64;
procedure ini;
var i:integer;
begin
assign(input,'factory.in');assign(output,'factory.out');
reset(input);rewrite(output);
readln(n,s);
for i:=1 to n do
readln(cost[i],need[i]);
for i:=1 to n do week[i]:=9999999999999;
end;
begin
ini;
for i:=1 to n do
for j:=i to n do
if ((j-i)*s+cost[i])<week[j] then week[j]:=(j-i)*s+cost[i];
tot:=0;
for i:=1 to n do
tot:=tot+week[i]*need[i];
write(tot);
close(input);close(output);
end.