#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, a, b[N], p[N], cur = 0;
bool check(int mid) {
  if (mid > m) return false;
  int idx = 0;
  int spent = 0;
  int tmp = a;
  for (int i = n - mid; i < n; i++) {
    if (p[idx] - b[i] > tmp) return false;
    tmp -= max(0, p[idx] - b[i]);
    spent += p[idx];
    idx++;
  }
  cur = max(0, spent - a);
  return true;
}
int main() {
  scanf("%d%d%d", &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 lo = 0, hi = n;
  int ans1, ans2;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (check(mid)) {
      ans1 = mid;
      ans2 = cur;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}
