#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f;
  cin >> n >> f;
  int d, i, c, count = 0, car = 0;
  vector<pair<int, int> > v;
  int h[4000] = {0};
  int dc[n];
  for (i = 0; i < n; i++) {
    cin >> d >> c;
    h[d] += c;
    dc[i] = d;
  }
  int n2 = *max_element(dc, dc + n);
  for (i = 1; i <= n2 + 1; i++) {
    if (car == 0) {
      if (h[i] < f)
        count += h[i];
      else {
        count += f;
        car = h[i] - f;
      }
    } else if (car < f) {
      count += car;
      count += min(h[i], f - car);
      car = max(0, h[i] - f + car);
    } else {
      count += f;
      car = h[i];
    }
  }
  cout << count << endl;
  return 0;
}
