#include <bits/stdc++.h>
using namespace std;
template <typename X>
ostream& operator<<(ostream& x, const vector<X>& v) {
  for (long long i = 0; i < v.size(); ++i) x << v[i] << " ";
  return x;
}
template <typename X>
ostream& operator<<(ostream& x, const set<X>& v) {
  for (auto it : v) x << it << " ";
  return x;
}
template <typename X, typename Y>
ostream& operator<<(ostream& x, const pair<X, Y>& v) {
  x << v.ff << " " << v.ss;
  return x;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  for (auto it : v) os << it.first << "=>" << it.second << endl;
  return os;
}
struct pair_hash {
  inline std::size_t operator()(
      const std::pair<long long, long long>& v) const {
    return v.first * 31 + v.second;
  }
};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
long long n, m, a, xx;
const int N = 100005;
;
long long b[N];
long long r[N];
pair<long long, long long> chk(int x) {
  if (x > n) {
    return {0, 0};
  }
  int j = n - 1;
  int i = x - 1;
  long long rem = 0;
  while (i >= 0) {
    rem += max(r[i] - b[j], 0LL);
    --i;
    --j;
  }
  long long sum = 0;
  for (long long i = 0; i < x; i++) {
    sum += r[i];
  }
  return {rem <= xx, max(sum - xx, 0LL)};
}
int main() {
  cin >> n >> m >> a;
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  };
  for (long long i = 0; i < m; i++) {
    cin >> r[i];
  };
  sort(b, b + n);
  sort(r, r + m);
  xx = a;
  int lo = 1;
  int hi = m;
  if (chk(m).first) {
    cout << m << ' ' << chk(m).second << endl;
    return 0;
  }
  if (!chk(1).first) {
    cout << 0 << ' ' << 0 << endl;
    return 0;
  }
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    pair<long long, long long> xx = chk(mid);
    if (xx.first) {
      lo = mid + 1;
      if (!chk(lo).first) {
        lo = mid;
        break;
      }
    } else {
      hi = mid - 1;
    }
  }
  cout << lo << " " << chk(lo).second << endl;
}
