#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353ll;
const long long int P = 1000000009ll;
const long long int N = 200005ll;
pair<long long int, long long int> a[N];
long long int b[N];
long long int s[N];
bool cmp(long long int x, long long int y) { return x > y; }
void solve() {
  long long int n, m, k;
  cin >> n >> m >> k;
  k = min(k, n);
  for (long long int i = (1); i <= (n); ++i) cin >> a[i].first >> a[i].second;
  long long int ans = 0;
  for (long long int i = (1); i <= (n); ++i) {
    ans += a[i].second;
    b[i] = max((long long int)0, a[i].first - a[i].second);
  }
  sort(b + 1, b + n + 1, cmp);
  if (k == 0) {
    cout << ans;
    return;
  }
  for (long long int i = (1); i <= (n); ++i) s[i] = s[i - 1] + b[i];
  long long int t = ans;
  for (long long int i = (0); i <= (n); ++i) {
    long long int x = (a[i].first << m) - a[i].second;
    long long int y = max((long long int)0, a[i].first - a[i].second);
    long long int maxi = 0;
    if (b[k] <= y)
      maxi = s[k] - y;
    else
      maxi = s[k - 1];
    maxi += x;
    ans = max(ans, t + maxi);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
