#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wwrite-strings"
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &out, const pair<T, U> &A) {
  out << A.first << "_" << A.second;
  return out;
}
template <template <typename, typename> class ContainerT, typename ValueT>
ostream &operator<<(ostream &out,
                    const ContainerT<ValueT, std::allocator<ValueT> > &A) {
  for (__typeof((A).begin()) i = (A).begin(); i != (A).end(); ++i)
    out << *i << " ";
  return out;
}
template <template <typename, typename> class ContainerT, typename ValueT,
          typename ValueU>
ostream &operator<<(
    ostream &out, const ContainerT<pair<ValueT, ValueU>,
                                   std::allocator<pair<ValueT, ValueU> > > &A) {
  for (__typeof((A).begin()) i = (A).begin(); i != (A).end(); ++i)
    out << *i << " ";
  return out;
}
template <class T>
void mini(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
void maxi(T &a, const T &b) {
  if (b > a) a = b;
}
template <class T, class U>
pair<T, U> operator+(const pair<T, U> &a, const pair<T, U> &b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <class T, class U>
pair<T, U> operator-(const pair<T, U> &a, const pair<T, U> &b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <class T, class U, class S>
pair<T, U> operator*(const pair<T, U> &a, const S &b) {
  return make_pair(a.first * b, a.second * b);
}
template <class T, class U, class S>
pair<T, U> operator*(const S &b, const pair<T, U> &a) {
  return make_pair(a.first * b, a.second * b);
}
template <class T, class U>
void operator+=(pair<T, U> &a, const pair<T, U> &b) {
  a.first += b.first;
  a.second += b.second;
}
template <class T, class U>
void operator-=(pair<T, U> &a, const pair<T, U> &b) {
  a.first -= b.first;
  a.second -= b.second;
}
template <class T, class U, class S>
void operator*=(pair<T, U> &a, const S &b) {
  a.first *= b;
  a.second *= b;
}
template <class T, class U, class S>
void operator*=(const S &b, pair<T, U> &a) {
  a.first *= b;
  a.second *= b;
}
template <class T>
T sum(const pair<T, T> &A) {
  return A.first + A.second;
}
template <class T>
T abs(const pair<T, T> &A) {
  return sqrt(A.first * A.first + A.second * A.second);
}
template <class T>
void swap(pair<T, T> &A) {
  T val = A.first;
  A.first = A.second;
  A.second = A.first;
}
template <class T>
bool inRange(T val, pair<T, T> range) {
  if (range.first > range.second) swap(range);
  return val >= range.first and val < range.second;
}
int n, v;
vector<pair<int, int> > A;
vector<int> ans;
int put(int idx, int val) {
  int able = v - ans[idx];
  int d = min(able, val);
  ans[idx] += d;
  assert(ans[idx] <= v);
  return d;
}
long long solve() {
  cin >> n >> v;
  A = vector<pair<int, int> >(n);
  for (int i = 0; i < (n); ++i) cin >> A[i].first >> A[i].second;
  ans = vector<int>(3002, 0);
  sort((A).begin(), (A).end());
  for (__typeof((A).begin()) i = (A).begin(); i != (A).end(); ++i) {
    (*i).second -= put((*i).first, (*i).second);
    put((*i).first + 1, (*i).second);
  }
  return accumulate((ans).begin(), (ans).end(), 0);
}
int main() {
  cout << solve() << endl;
  return 0;
}
