#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, v;
  cin >> n >> v;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    mp[a] += b;
  }
  long long count = 0;
  for (auto x : mp) {
    if (x.second > v) {
      count += v;
      x.second -= v;
      mp[x.first + 1] += min(x.second, v);
    } else
      count += x.second;
  }
  cout << count << "\n";
  return 0;
}
