#include <iostream>
#include <cstdio>
using namespace std;
int main(void)
{
freopen("factory.in","r",stdin);
freopen("factory.out","w",stdout);
int i,j,n,s;
long long temp,mincost,total=0,neo[10000],need[10000];
cin>>n>>s;
for (i=0;i<n;i++)
{
cin>>neo[i]>>need[i];
mincost=need[i]*neo[i];
for (j=i-1;j>=0;j--)
{
temp=need[i]*neo[j]+need[i]*(i-j)*s;
if (temp<mincost)
mincost=temp;
}
total+=mincost;
}
cout<<total<<endl;
fclose(stdin);
fclose(stdout);
return(0);
}