#include <bits/stdc++.h>
using namespace std;
long long int MAX = 1e9, max_int = 1e6;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, v, i, x, y, s = 0;
  cin >> n >> v;
  map<int, int> m;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    m[x] += y;
  }
  for (i = 1; i <= 3001; i++) {
    x = m[i] + m[i - 1];
    if (x > v) {
      s += v;
      if (m[i - 1] >= v) {
        m[i - 1] -= v;
      } else {
        m[i] = m[i] - v + m[i - 1];
        m[i - 1] = 0;
      }
    } else {
      s += m[i - 1] + m[i];
      m[i - 1] = 0;
      m[i] = 0;
    }
  }
  cout << s;
}
