#include <iostream>
using namespace std;
const long long MAX=10001;
const long long INF=0x7FFFFFFF;
int N,S;
int C[MAX],Y[MAX];
long long mincost,percost,totalcost;
void init()
{
int i;
freopen("factory.in","r",stdin);
freopen("factory.out","w",stdout);
scanf("%d%d",&N,&S);
for (i=1;i<=N;i++)
{
scanf("%d%d",&C[i],&Y[i]);
}
}
void deal()
{
int i,j;
for (i=1;i<=N;i++)
{
mincost=INF;
for (j=1;j<=i;j++)
{
percost=(i-j)*S+C[j];
if (percost<mincost)
mincost=percost;
}
totalcost+=mincost*Y[i];
}
}
int main()
{
init();
deal();
cout << totalcost << endl;
return 0;
}