#include <bits/stdc++.h>
using namespace std;
int f[3005];
int main() {
  int n, k, cnt = 0, a, b, maxim = -1;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    f[a] = f[a] + b;
    maxim = max(maxim, a);
  }
  for (int i = 1; i <= maxim + 1; i++) {
    int minim;
    if (f[i - 1] > k) {
      minim = k;
    } else
      minim = f[i - 1];
    cnt = cnt + minim;
    f[i - 1] = f[i - 1] - minim;
    cnt += min(k - minim, f[i]);
    f[i] = f[i] - min(k - minim, f[i]);
  }
  cout << cnt;
}
