#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, l, a[1000009], b[1000009], p[1000009], ans, cn, t, x, y, z,
    mx, mn, s, lo, hi, mid, cost, res, flag;
int main() {
  while (scanf("%d %d %d", &n, &m, &x) != EOF) {
    ans = x;
    cost = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &b[i]);
    }
    sort(b, b + n);
    for (i = 0; i < m; i++) {
      scanf("%d", &p[i]);
    }
    sort(p, p + m);
    lo = 0;
    hi = min(n, m);
    while (lo <= hi) {
      flag = 0;
      ans = x;
      mid = (lo + hi) / 2;
      cn = 0;
      j = 0;
      for (i = n - mid; i < n; i++) {
        if (p[j] > ans + b[i]) {
          flag = 1;
          break;
        } else {
          cn += p[j];
          ans -= max(0, p[j] - b[i]);
          j++;
        }
      }
      if (flag == 1) {
        hi = mid - 1;
      } else {
        cost = cn;
        res = mid;
        lo = mid + 1;
      }
    }
    cost = max(0, cost - x);
    printf("%d %d\n", res, cost);
  }
  return 0;
}
