#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1e9 + 5;
const double eps = 1e-7;
const double PI = acos(-1.0);
inline void debug_vi(vector<int> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
inline void debug_vll(vector<long long> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
inline void print_case(int tn) { cout << "Case #" << tn << ": "; }
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxpq = priority_queue<T>;
const int nax = 1e5 + 5;
int n, m, a;
vector<int> b, p;
bool good(int idx, long long &pc) {
  int aa = a;
  int bi = (n - 1 - idx);
  vector<int> acost(m), bcost(m);
  for (long long i = (long long)(0); i < (long long)(idx + 1); i++) {
    int need = p[i];
    bcost[i] = min((bi < n) ? b[bi] : 0, need);
    need -= bcost[i];
    bi++;
    if (aa < need) return false;
    aa -= need;
    acost[i] = need;
  }
  pc = 0;
  for (long long i = (long long)(0); i < (long long)(idx + 1); i++) {
    int acontrib = min(bcost[i], aa);
    bcost[i] -= acontrib;
    acost[i] += acontrib;
    aa -= acontrib;
    pc += 1LL * bcost[i];
  }
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  clock_t clk = clock();
  cin >> n >> m >> a;
  b.resize(n);
  p.resize(m);
  for (long long i = (long long)(0); i < (long long)(n); i++) cin >> b[i];
  for (long long i = (long long)(0); i < (long long)(m); i++) cin >> p[i];
  sort((b).begin(), (b).end());
  sort((p).begin(), (p).end());
  int r = -1;
  long long s = 0;
  int lo = 0, hi = min(n, m) - 1;
  while (lo <= hi) {
    int mid = (lo + hi) >> 1;
    long long sp = 0;
    if (good(mid, sp)) {
      r = mid;
      s = sp;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  cout << r + 1 << " " << s;
  cerr << "\n"
       << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << "\n";
  return 0;
}
