#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
const long long int inf = -1e18;
const int mod = 1e9 + 7;
long long int b[N], cost[N];
long long int n, m, a, ans;
bool calc(long long int mid) {
  long long int t = a, total = 0;
  if (mid > m) return 0;
  for (int i = mid - 1, j = 0; i >= 0 && j < mid; i--, j++) {
    if (cost[j] > b[i]) {
      t -= (cost[j] - b[i]);
      total += b[i];
    } else
      total += cost[j];
    if (t < 0) return 0;
  }
  ans = max(0ll, total - t);
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> a;
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < m; i++) cin >> cost[i];
  sort(b, b + n);
  for (int i = 0, j = n - 1; i <= j; i++, j--) {
    swap(b[i], b[j]);
  }
  sort(cost, cost + m);
  long long int lo = 0, hi = n + 1, mid;
  while (hi - lo > 1) {
    mid = hi + lo >> 1;
    if (calc(mid))
      lo = mid;
    else
      hi = mid;
  }
  calc(lo);
  cout << lo << " " << ans;
  return 0;
}
