#include <bits/stdc++.h>
using namespace std;
const int debug = 1;
int n, v;
pair<int, int> a[10005], b[10005];
int d[10005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> v;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  a[0].first = 0;
  a[0].second = 0;
  sort(a + 1, a + n + 1);
  int i = 1, k = 0;
  while (i <= n) {
    d[a[i].first] = a[i].second;
    int j;
    for (j = i + 1; j <= n; j++)
      if (a[i].first != a[j].first)
        break;
      else
        d[a[i].first] += a[j].second;
    i = j;
  }
  n = a[n].first;
  if (!debug)
    for (int i = 1; i <= n; i++) cout << d[i] << endl;
  int res = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (d[i - 1] > 0) {
      res += min(v, d[i] + d[i - 1]);
      if (d[i - 1] >= v)
        d[i - 1] -= v;
      else {
        int temp = v - d[i - 1];
        d[i - 1] = 0;
        if (temp <= d[i])
          d[i] -= temp;
        else
          d[i] = 0;
      }
    } else {
      res += min(v, d[i]);
      if (d[i] >= v)
        d[i] -= v;
      else
        d[i] = 0;
    }
    if (!debug) cout << d[i] << endl;
  }
  cout << res << endl;
  return 0;
}
