#include <bits/stdc++.h>
using namespace std;
int main() {
  int(n);
  cin >> n;
  int(Vmax);
  cin >> Vmax;
  array<int, 3001> f;
  array<int, 3001> r;
  f.fill(0);
  r.fill(0);
  for (int i = 0; i < n; i++) {
    int(a);
    cin >> a;
    int(b);
    cin >> b;
    f[a - 1] += b;
  }
  int sum = 0;
  for (int i = 0; i < 3001; i++) {
    int v = Vmax;
    int cr = min(v, r[i]);
    sum += cr;
    v -= cr;
    int cf = min(v, f[i]);
    sum += cf;
    r[i + 1] += f[i] - cf;
  }
  cout << (sum) << '\n';
  return 0;
}
