#include <bits/stdc++.h>
struct ss {
  int day;
  int cap;
};
struct cc {
  bool operator()(struct ss ob1, struct ss ob2) { return ob1.day > ob2.day; }
} comp;
int main() {
  int n, i;
  int cap;
  int maxi = -1e9;
  int day[100009];
  struct ss st[100009];
  scanf("%d%d", &n, &cap);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &st[i].day, &st[i].cap);
    day[st[i].day] += st[i].cap;
    if (st[i].day > maxi) maxi = st[i].day;
  }
  int s = 0;
  for (i = 1; i <= maxi + 1; i++) {
    if (cap > day[i - 1]) {
      if (day[i] > cap - day[i - 1]) {
        day[i] = day[i] - (cap - day[i - 1]);
        s += cap;
      } else {
        s += day[i - 1] + day[i];
        day[i] = 0;
      }
      day[i - 1] = 0;
    } else {
      if (day[i - 1] > cap) {
        s += cap;
        day[i - 1] = day[i - 1] - cap;
      } else {
        s += day[i - 1];
        day[i - 1] = 0;
      }
    }
  }
  printf("%d\n", s);
  return 0;
}
