program factory;
var n:longint;
s:longint;
cost:array[1..10000] of integer;
need:array[1..10000] of integer;
fi,fo:text;
x1,x2:longint;
xuyao:longint;
ls:longint;
jg:longint;
begin
assign(fi,'factory.in');
reset(fi);
readln(fi,n,s);
for x1:=1 to n do
readln(fi,cost[x1],need[x1]);
close(fi);
jg:=0;
for x1:=1 to n do
begin
xuyao:=maxlongint;
for x2:=1 to x1 do
begin
ls:=cost[x2]*need[x1]+(x1-x2)*s*need[x1];
if ls<xuyao then xuyao:=ls;
end;
jg:=jg+xuyao;
end;
assign(fo,'factory.out');
rewrite(fo);
writeln(fo,jg);
close(fo);
end.