#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline long long modMul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
inline long long modAdd(long long a, long long b) {
  return ((a % mod) + (b % mod)) % mod;
}
inline long long modPow(long long b, long long p) {
  long long r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline long long modInverse(long long a) { return modPow(a, mod - 2); }
inline long long modDiv(long long a, long long b) {
  return modMul(a, modInverse(b));
}
long long const maxn = 2 * 100000 + 1;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
bool comp(long long a, long long b) { return a > b; }
long long power(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2 == 0) {
      a = ((a) * (a));
      n = n / 2;
    } else {
      n--;
      res = ((a) * (res));
    }
  }
  return res;
}
long long temp;
bool isvalid(long long bikes[], long long personal[], long long mid,
             long long a, long long m, long long n) {
  long long start = n - mid;
  long long money = a;
  long long sum = 0;
  for (long long i = 1; i < mid + 1; i++) {
    sum += bikes[i];
    if (bikes[i] <= personal[start + i]) {
      continue;
    }
    money = money - (bikes[i] - personal[start + i]);
    if (money < 0) {
      return false;
    }
  }
  if (a >= sum) {
    temp = 0;
    return true;
  } else {
    temp = sum - a;
    return true;
  }
}
void solve() {
  long long n;
  cin >> n;
  long long m;
  cin >> m;
  long long a;
  cin >> a;
  long long personal[n + 1];
  personal[0] = 0;
  for (long long i = 1; i < n + 1; i++) {
    cin >> personal[i];
  }
  sort(personal, personal + 1 + n);
  long long bikes[m + 1];
  bikes[0] = 0;
  for (long long i = 1; i < m + 1; i++) {
    cin >> bikes[i];
  }
  sort(bikes, bikes + 1 + m);
  long long start = 0;
  long long last = min(m, n);
  long long ans = INT_MIN;
  long long cnt = INT_MIN;
  while (start <= last) {
    long long mid = start + (last - start) / 2;
    if (isvalid(bikes, personal, mid, a, m, n)) {
      if (cnt < mid) {
        cnt = mid;
        ans = temp;
        start = mid + 1;
      }
      if (cnt == mid) {
        ans = min(ans, temp);
      }
    } else {
      last = mid - 1;
    }
  }
  cout << cnt << " " << ans << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long test;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
