#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  if (a > b) a = b;
  return a;
}
int max(int a, int b) {
  if (a < b) a = b;
  return a;
}
struct node1 {
  int a, b;
} node[3005];
int cmp(const void* a, const void* b) {
  struct node1* aa = (struct node1*)a;
  struct node1* bb = (struct node1*)b;
  return aa->a - bb->a;
}
int main() {
  int n, v;
  scanf("%d%d", &n, &v);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &node[i].a, &node[i].b);
  }
  qsort(node, n, sizeof(node1), cmp);
  int day = node[0].a, p = 0, cnt = v, ans = 0;
  while (p < n) {
    cnt = v;
    while (node[p].a < day - 1) p++;
    while (cnt && p < n && node[p].a <= day) {
      if (node[p].b <= cnt) {
        ans += node[p].b;
        cnt -= node[p].b;
        p++;
      } else {
        ans += cnt;
        node[p].b -= cnt;
        cnt = 0;
      }
    }
    if (node[p].a > day) {
      day = node[p].a;
    } else
      day++;
  }
  printf("%d\n", ans);
}
