#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long a[3010], b[3010];
int main() {
  long long n, maximun;
  cin >> n >> maximun;
  for (long long i = 1; i <= n; i++) {
    long long day, quan;
    cin >> day >> quan;
    a[day] += quan;
  }
  long long rem = 0, ans = 0;
  for (long long i = 1; i <= 3009; i++) {
    long long first = min(rem, maximun);
    ans += first;
    long long second = min(a[i], maximun - first);
    ans += second;
    a[i] -= second;
    rem = a[i];
  }
  cout << ans << endl;
}
