#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool isLeap(T y) {
  return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);
}
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <class T>
inline T BigMod(T Base, T power, T M = 1000000007) {
  if (power == 0) return 1;
  if (power & 1)
    return ((Base % M) * (BigMod(Base, power - 1, M) % M)) % M;
  else {
    T y = BigMod(Base, power / 2, M) % M;
    return (y * y) % M;
  }
}
template <class T>
inline T ModInv(T A, T M = 1000000007) {
  return BigMod(A, M - 2, M);
}
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
long long a[100005], b[100005], cum[100005], p[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  long long a;
  cin >> n >> m >> a;
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < m; i++) cin >> p[i];
  sort(b, b + n);
  sort(p, p + m);
  for (int i = 0; i < m; i++) {
    if (!i)
      cum[i + 1] = p[i];
    else
      cum[i + 1] = cum[i] + p[i];
  }
  int low = 0, high = n, mid;
  long long ans = 1e16, save = 0;
  while (low <= high) {
    mid = (low + high) >> 1;
    if (mid > m) {
      high = mid - 1;
      continue;
    }
    long long x = a;
    int flag = 0;
    int i, j;
    for (i = mid - 1, j = n - 1; i >= 0 && j >= 0; i--, j--) {
      if (b[j] >= p[i])
        continue;
      else if (b[j] + x >= p[i]) {
        x -= (p[i] - b[j]);
      } else {
        flag = 1;
        break;
      }
    }
    if (flag)
      high = mid - 1;
    else {
      low = mid + 1;
      ans = max(cum[mid] - a, 0ll);
      save = mid;
    }
  }
  if (ans == 1e16)
    cout << 0 << " " << 0;
  else
    cout << save << " " << ans;
  return 0;
}
