#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
long long a[maxn], b[maxn];
long long ansc, v;
bool cmp(long long a, long long b) { return a > b; }
bool solve(int k) {
  int t = 0, j = k - 1, vv = v;
  for (int i = 0; i < k; i++) {
    if (a[i] >= b[j])
      t += b[j];
    else {
      t += a[i];
      vv -= (b[j] - a[i]);
    }
    if (vv < 0) break;
    j--;
  }
  if (vv < 0) return false;
  ansc = t - vv <= 0 ? 0 : t - vv;
  return true;
}
int main() {
  long long n, m, r, l, ans = 0, mid;
  scanf("%lld%lld%lld", &n, &m, &v);
  for (int i = 0; i < n; i++) scanf("%lld", a + i);
  sort(a, a + n, cmp);
  for (int i = 0; i < m; i++) scanf("%lld", b + i);
  sort(b, b + m);
  l = 1, r = min(n, m);
  while (l <= r) {
    mid = (l + r) >> 1;
    if (solve(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (ans == 0)
    printf("0 0\n");
  else
    printf("%lld %lld\n", ans, ansc);
  return 0;
}
