#include <bits/stdc++.h>
using namespace std;
template <typename X>
X gcd(X a, X b) {
  if (!b)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n, v1;
  cin >> n >> v1;
  vector<pair<int, int> > v;
  int x, y;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  int cnt = 1;
  int f = 0;
  int i;
  int cnt2 = 0;
  while (1) {
    int limit = v1;
    for (i = 0; i < n; i++) {
      if ((cnt - v[i].first) == 0 || (cnt - v[i].first) == 1) {
        if (limit > 0) {
          if (limit >= v[i].second && v[i].second) {
            f += v[i].second;
            limit -= v[i].second;
            v[i].second = 0;
            cnt2++;
          } else if (v[i].second) {
            f += limit;
            v[i].second -= limit;
            limit = 0;
          }
        } else
          break;
      } else if (v[i].second && cnt > (v[i].first + 1)) {
        v[i].second = 0;
        cnt2++;
      }
    }
    if (cnt2 == n) break;
    cnt++;
  }
  cout << f << "\n";
}
