#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10;
long long n, r, avg, a[MAXN], b, o = 0, sums = 0, k = 0;
long long i;
pair<long long, long long> d[MAXN];
int main() {
  cin >> n >> r >> avg;
  avg *= n;
  for (i = 0; i < n; i++) {
    cin >> a[i] >> b;
    sums += a[i];
    if (a[i] < r) {
      d[o] = make_pair(b, i);
      o++;
    }
  }
  sort(d, d + o);
  if (avg <= sums) {
    cout << 0;
    return 0;
  }
  for (i = 0; i < o; i++) {
    if ((r - a[d[i].second] + sums) < avg) {
      k += (r - a[d[i].second]) * d[i].first;
      sums += (r - a[d[i].second]);
      a[d[i].second] = r;
    } else {
      k += (avg - sums) * d[i].first;
      a[d[i].second] += avg - sums;
      sums = avg;
      break;
    }
  }
  cout << k;
  return 0;
}
