#include <bits/stdc++.h>
using namespace std;
long long n, m, pre, ans, x, y;
long long paisa[200005], bikes[200005];
bool ok(long long k) {
  long long can = pre;
  long long j = n - k;
  ans = 0;
  for (long long i = 0; i < k; i++, j++) {
    if (paisa[j] >= bikes[i]) {
      ans += bikes[i];
    } else if (bikes[i] - paisa[j] <= can) {
      ans += paisa[j];
      can -= bikes[i] - paisa[j];
    } else
      return false;
  }
  ans = max(0LL, ans - can);
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> pre;
  for (long long i = 0; i < n; i++) cin >> paisa[i];
  for (long long j = 0; j < m; j++) cin >> bikes[j];
  sort(paisa, paisa + n);
  sort(bikes, bikes + m);
  long long low = 1, high = min(n, m);
  while (low <= high) {
    long long mid = (low + high) / 2;
    if (ok(mid)) {
      x = mid;
      y = ans;
      low = mid + 1;
    } else
      high = mid - 1;
  }
  cout << x << " " << y;
  return 0;
}
