#include <bits/stdc++.h>
using namespace std;
void google(int t) { cout << "Case #" << t << ": "; }
void solve() {
  long long n, m, a;
  cin >> n >> m >> a;
  long long b[n], p[m];
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (long long j = 0; j < m; j++) {
    cin >> p[j];
  }
  sort(b, b + n);
  sort(p, p + m);
  long long l = 0, h = min(m, n), mid;
  long long ms = 0;
  long long ans = 0;
  while (l <= h) {
    long long tmp = 0;
    long long cur = a;
    bool ok = true;
    mid = (l + h) / 2;
    long long j = n - mid;
    for (long long i = 0; i < mid; i++) {
      if (b[j] >= p[i]) {
        tmp += p[i];
      } else {
        tmp = tmp + b[j];
        cur = cur - (p[i] - b[j]);
        if (cur < 0) {
          ok = false;
          break;
        }
      }
      j++;
    }
    if (ok) {
      ans = mid;
      ms = tmp - cur;
      if (ms < 0) ms = 0;
      l = mid + 1;
    } else {
      h = mid - 1;
    }
  }
  cout << ans << " " << ms << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  solve();
}
