#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[11119];
int main() {
  int n, m, x, v;
  cin >> n >> v;
  for (typeof((n)-1) i = (0); i <= ((n)-1); i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  int ans = 0;
  int sum = 0;
  int cur = -1;
  int i = 0;
  while (i < n) {
    int sum = 0;
    int x;
    while (a[i].first < cur - 1 && i < n) i++;
    while (sum < v && (a[i].first == cur || a[i].first == cur - 1) && i < n) {
      if (sum + a[i].second >= v) {
        a[i].second = sum + a[i].second - v;
        sum = v;
      } else {
        sum += a[i].second;
        i++;
      }
    }
    cur++;
    ans += sum;
  }
  cout << ans << endl;
  return 0;
}
