#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[100001];
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  if (x.second < y.second) return true;
  return false;
}
long long n, r, avg, i, peste = 0, sub = 0, x, y;
int main(int argc, const char* argv[]) {
  cin >> n >> r >> avg;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    a[i] = make_pair(x, y);
    if (a[i].first > avg) peste += a[i].first - avg;
    if (a[i].first < avg) sub += avg - a[i].first;
  }
  sort(a + 0, a + n, cmp);
  long long nev = sub - peste;
  if (nev <= 0) {
    cout << 0;
    return 0;
  }
  long long nres = 0;
  for (i = 0; i < n; i++) {
    if (a[i].first < r && nev > 0) {
      if (r - a[i].first <= nev) {
        nres += a[i].second * (r - a[i].first);
        nev -= r - a[i].first;
      } else {
        nres += a[i].second * nev;
        nev = 0;
        break;
      }
    }
  }
  cout << nres;
  return 0;
}
