#include <bits/stdc++.h>
using namespace std;
long long n, m, i, A, kol, a[500001], j, b[500001], l, r, k, B, ans;
bool was;
bool cmp(int q, int w) { return q > w; }
int main() {
  cin >> n >> m >> B;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= m; i++) cin >> b[i];
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  l = 1;
  r = min(n, m);
  while (l <= r) {
    k = (l + r) / 2;
    j = n;
    A = B;
    was = false;
    for (i = k; i >= 1; i--, j--) {
      if (a[j] >= b[i]) continue;
      if (a[j] + A >= b[i]) {
        A -= b[i] - a[j];
        continue;
      }
      was = true;
      break;
    }
    if (was)
      r = k - 1;
    else
      ans = k, l = k + 1;
  }
  cout << ans << " ";
  k = ans;
  ans = 0;
  j = n;
  A = B;
  for (i = k; i >= 1; i--, j--) {
    if (a[j] >= b[i])
      ans += b[i];
    else if (a[j] + A >= b[i]) {
      ans += a[j];
      A -= b[i] - a[j];
    }
  }
  cout << max(ans - A, 0ll);
  return 0;
}
