#include <bits/stdc++.h>
using namespace std;
int n, m, a;
int b[100010], p[100010];
int Solve(int mid) {
  int t = a;
  int i = n - 1, j = mid - 1;
  int ret = 0;
  while (i >= 0 && j >= 0) {
    if (b[i] >= p[j]) {
      ret += p[j];
    } else if (b[i] + t >= p[j]) {
      ret += b[i];
      t -= p[j] - b[i];
    } else
      return -1;
    --i;
    --j;
  }
  assert(j == -1);
  return max(0, ret - t);
}
int main() {
  while (cin >> n >> m >> a) {
    for (int i = 0; i < (n); i++) scanf("%d", b + i);
    for (int i = 0; i < (m); i++) scanf("%d", p + i);
    sort(b, b + n);
    sort(p, p + m);
    int st = 1, ed = min(n, m);
    int cost = 0;
    while (st <= ed) {
      int mid = st + ed >> 1;
      int c = Solve(mid);
      if (c >= 0) {
        st = mid + 1;
        cost = c;
      } else {
        ed = mid - 1;
      }
    }
    cout << ed << " " << cost << endl;
  }
  return 0;
}
