#include<bits/stdc++.h>
using namespace std;
long long a[100001],b[100001],n,m,s;
int main(){
cin>>n>>m;
cin>>a[0]>>b[0];
s+=a[0]*b[0];
long long x=a[0];
for(int i=1;i<n;i++){
cin>>a[i]>>b[i];
if(x+m<a[i]) x+=m;
else x=a[i];
s+=x*b[i];
}
cout<<s;
return 0;
}