#include <bits/stdc++.h>
using namespace std;
long long ripe[3033];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, k, i, j, l, d, r;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> d >> r;
    ripe[d] += r;
  }
  long long ans = 0;
  for (i = 1; i <= 3003; i++) {
    long long can = m;
    if (ripe[i - 1] <= can) {
      ans += ripe[i - 1];
      can -= ripe[i - 1];
    } else {
      ans += can;
      can = 0;
    }
    if (ripe[i] <= can) {
      ans += ripe[i];
      ripe[i] = 0;
    } else {
      ans += can;
      ripe[i] -= can;
    }
  }
  cout << ans << endl;
  return 0;
}
