#include <bits/stdc++.h>
using namespace std;
int n, m, a;
int b[100005];
int p[100005];
int main() {
  cin >> n >> m >> a;
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> p[i];
  }
  sort(b, b + n);
  sort(p, p + m);
  int hi = min(m, n), lo = 0, mid;
  int ans = 0, ms = 0;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    int cur = a;
    int tmp = 0;
    bool ok = true;
    int j = n - mid;
    for (int i = 0; i < mid; ++i) {
      if (b[j] >= p[i]) {
        tmp += p[i];
      } else if (b[j] < p[i]) {
        tmp += b[j];
        cur -= p[i] - b[j];
        if (cur < 0) {
          ok = false;
          break;
        }
      }
      ++j;
    }
    if (ok) {
      ans = mid;
      ms = tmp - cur;
      if (ms < 0) ms = 0;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  cout << ans << " " << ms << endl;
  return 0;
}
