program factory;
var
milk:array[1..10000]of record
m{money},n{need}:integer;
end;
n,s,min,i,j:longint;
max:int64;
begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input);
rewrite(output);
readln(n,s);
for i:=1 to n do
readln(milk[i].m,milk[i].n);
max:=0;
for i:=n downto 1 do
begin
min:=2147483647;
for j:=i downto 1 do
if s*(i-j)+milk[j].m<min then min:=s*(i-j)+milk[j].m;
max:=max+min*milk[i].n;
end;
writeln(max);
close(input);
close(output);
end.