#include <bits/stdc++.h>
using namespace std;
vector<long long> b;
vector<long long> p;
long long a;
bool c(long long k, long long *l) {
  long long need = 0;
  long long sp = 0;
  for (int i = 0; i < k; i++) {
    sp += p[i];
    need += max(0ll, p[i] - b[k - 1 - i]);
  }
  if (need <= a) {
    *l = max(0ll, sp - a);
    return true;
  }
  return false;
}
int main() {
  int n, m;
  cin >> n >> m >> a;
  b.resize(n);
  p.resize(m);
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < m; i++) cin >> p[i];
  sort(b.rbegin(), b.rend());
  sort(p.begin(), p.end());
  int b = 0, d = min(n, m) + 1;
  long long best = a;
  while (d - b > 1) {
    int x = (b + d) / 2;
    if (c(x, &best)) {
      b = x;
    } else {
      d = x;
    }
  }
  cout << b << " " << best;
  return 0;
}
