#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1e9 + 7;
const int N = 2e5 + 1;
int ar[N], n, per, av[N];
int main() {
  int a, b, day = 0;
  cin >> n >> per;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    day = max(day, a);
    av[a] += b;
  }
  int x = 0, mn, rem;
  for (int i = 1; i <= day + 1; i++) {
    rem = per;
    mn = min(rem, av[i - 1]);
    rem -= mn, av[i - 1] -= mn;
    x += mn;
    mn = min(rem, av[i]);
    rem -= mn, av[i] -= mn;
    x += mn;
  }
  cout << x;
  return 0;
}
