#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, r, avg, sum = 0, minm = 0, x, y, temp;
  cin >> n >> r >> avg;
  vector<pair<long long int, long long int> > a;
  long long int q = n;
  while (n--) {
    cin >> x >> y;
    a.push_back(make_pair(y, x));
    sum += x;
  }
  long long int avg1 = sum / q;
  sort(a.begin(), a.end());
  long long int i = 0;
  while (sum < avg * q) {
    temp = min(r - a[i].second, avg * q - sum);
    minm += temp * a[i].first;
    sum += temp;
    i++;
  }
  cout << minm << endl;
}
