#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
bool day[3000];
int frts[3000];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    frts[a] += b;
  }
  for (int i = 0; i < 3000; i++) {
    int mn, rem = k;
    if (i) {
      mn = min(frts[i - 1], rem);
      rem -= mn;
      sum += mn;
    }
    if (rem) {
      mn = min(frts[i], rem);
      frts[i] -= mn;
      sum += mn;
    }
  }
  sum += min(frts[2999], k);
  printf("%d\n", sum);
  return 0;
}
