#include <bits/stdc++.h>
using namespace std;
bool srt(pair<long long, long long> &a, pair<long long, long long> &b) {
  return a.second < b.second;
}
int main() {
  long long n, r, avg;
  cin >> n >> r >> avg;
  long long curr = 0;
  long long ans = 0;
  vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
    curr += v[i].first;
  }
  sort(v.begin(), v.end(), srt);
  long long i = 0;
  while (curr < n * avg) {
    long long x = n * avg - curr;
    if (v[i].first == r) {
      i++;
    } else {
      long long y = min(r - v[i].first, x);
      curr += y;
      v[i].first += y;
      ans += y * v[i].second;
    }
  }
  cout << ans;
}
