#include <bits/stdc++.h>
using namespace std;
vector<int> B, P;
void TheSolution(istream& input, ostream& output) {
  int n, m;
  long long a;
  input >> n >> m >> a;
  B = vector<int>(n);
  P = vector<int>(m);
  for (int i = 0; i < n; ++i) input >> B[i];
  for (int i = 0; i < m; ++i) input >> P[i];
  sort(B.rbegin(), B.rend());
  sort((P).begin(), (P).end());
  long long sumB = 0, sumP = 0;
  long long r = 0, s = 0;
  int lo = -1, hi = min(n, m), mid;
  while (lo + 1 < hi) {
    long long aa = a;
    mid = (lo + hi) / 2;
    for (int i = 0; i <= mid; i++) {
      if (B[i] < P[mid - i]) {
        aa -= P[mid - i] - B[i];
      }
    }
    if (aa >= 0)
      lo = mid;
    else
      hi = mid;
  }
  r = lo + 1;
  for (int i = 0; i <= lo; i++) {
    s += min(B[i], P[lo - i]);
    if (B[i] < P[lo - i]) {
      a -= P[lo - i] - B[i];
    }
  }
  s = max(0ll, s - a);
  output << r << " " << s << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  TheSolution(cin, cout);
  return 0;
}
