program factory;
type
shuzu=array[1..10000,1..2] of longint;
shuzu1=array[1..10000] of qword;
var
f:shuzu;
z:shuzu1;
i,j,k,m,n:longint;
function min(x,y:qword):qword;
begin
if x>y then min:=y
else min:=x;
end;
begin
assign(input,'factory.in');reset(input);
assign(output,'factory.out');rewrite(output);
readln(n,s);
for i:=1 to n do
readln(f[i,1],f[i,2]);
for i:=1 to n do
for j:=0 to n-1 do
z[i]:=min(z[j]+f[i,1]*f[i,2],z[j]+f[j,1]*f[j,2]+s*f[i,2]);
writeln(z[n]);
close(output);
end.