#include <bits/stdc++.h>
using namespace std;
int p[100010], a[100010];
int sum;
long long ret, sum1[100010], sum2[100010];
bool cmp(int a, int b) { return a > b; }
bool find(int mid) {
  if (sum2[mid] > sum1[mid] + sum) return false;
  long long ret1, mm = 0, oo;
  ret1 = sum2[mid] - sum;
  if (ret1 <= 0) {
    ret = 0;
    return true;
  }
  ret = ret1;
  oo = sum;
  int kk;
  for (int i = 1; i <= mid; i++) {
    if (a[mid - i + 1] <= p[i])
      mm += a[mid - i + 1];
    else
      mm += p[i];
    if (mm >= ret1) return true;
    kk = p[i] - a[mid - i + 1];
    if (kk > oo) return false;
    if (kk > 0) oo -= kk;
  }
  return false;
}
int main() {
  int n, m, k, i;
  int L, R, mid, j;
  while (scanf("%d%d%d", &n, &m, &sum) != EOF) {
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (i = 1; i <= m; i++) scanf("%d", &p[i]);
    sum1[0] = sum2[0] = 0;
    sort(p + 1, p + m + 1);
    sort(a + 1, a + 1 + n, cmp);
    for (i = 1; i <= n; i++) sum1[i] = sum1[i - 1] + a[i];
    for (i = 1; i <= m; i++) sum2[i] = sum2[i - 1] + p[i];
    L = 0;
    R = min(n, m);
    ret = 0;
    while (L <= R) {
      mid = (L + R) >> 1;
      if (find(mid))
        L = mid + 1;
      else
        R = mid - 1;
    }
    mid = min(L, R);
    find(mid);
    printf("%d %I64d\n", mid, ret);
  }
  return 0;
}
