#include <bits/stdc++.h>
using namespace std;
vector<int> A, B;
bool check(int val, int c, int n) {
  long long int sum = 0;
  for (int i = 1, j = n - val + 1; i <= val; i++, j++) {
    if (B[i] > A[j]) sum += (B[i] - A[j]);
  }
  return c >= sum;
}
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  A.resize(n + 1);
  B.resize(m + 1);
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = 1; i <= m; i++) cin >> B[i];
  sort(A.begin() + 1, A.end());
  sort(B.begin() + 1, B.end());
  int L = 0, R = min(n, m), M;
  while (L <= R) {
    M = (L + R) / 2;
    bool f1 = check(M, c, n);
    bool f2 = check(M + 1, c, n);
    if (f1 && f2 == 0)
      break;
    else if (f1) {
      L = M + 1;
    } else {
      R = M - 1;
    }
  }
  cout << M << " ";
  long long int ans = 0;
  while (M) {
    if (A[n] <= B[M]) {
      ans += A[n];
      c -= (B[M] - A[n]);
    } else {
      ans += B[M];
    }
    M--;
    n--;
  }
  ans -= c;
  ans = max(ans, 0LL);
  cout << ans << endl;
  return 0;
}
