program cch(input,output);
var
cost:int64;
i,n,s,ci,yi,tot:longint;
heap:array[1..10000] of int64;
procedure ins(x:longint);
var
i,q:longint;
tmp:int64;
begin
for i:=1 to tot do heap[i]:=heap[i]+s;
inc(tot);
heap[tot]:=x;
q:=tot;
while (q>1)and(heap[q]<heap[q div 2]) do
begin
tmp:=heap[q];
heap[q]:=heap[q div 2];
heap[q div 2]:=tmp;
q:=q div 2;
end;
end;
begin
assign(input,'factory.in');
assign(output,'factory.out');
reset(input);
rewrite(output);
readln(n,s);
tot:=0;
for i:=1 to n do
begin
readln(ci,yi);
ins(ci);
cost:=cost+heap[1]*yi;
end;
write(cost);
close(input);
close(output);
end.