program factory;
const
fin='factory.in';
fou='factory.out';
var
y,c:array[1..10000]of longint;
s,n,i,j:longint;
min:int64;
f1,f2:text;
procedure init;
begin
assign(f1,fin);
assign(f2,fou);
reset(f1);
rewrite(f2);
read(f1,n,s);
for i:=1 to n do
read(f1,c[i],y[i]);
end;
begin
init;
for i:=2 to n do
if c[i]>c[i-1]+s then c[i]:=c[i-1]+s;
for i:=1 to n do
min:=min+c[i]*y[i];
write(f2,min);
close(f1); close(f2);
end.