#include <bits/stdc++.h>
using namespace std;
struct node {
  int fir, sec, val;
  bool operator<(const node& p) const {
    if (val == p.val) return fir >= p.fir;
    return val >= p.val;
  }
};
vector<int> bike, st;
int main() {
  int i, j, k, l, m, n, a, b, mid;
  cin >> n >> m >> a;
  for (i = 1; i <= n; i++) {
    cin >> l;
    st.push_back(l);
  }
  for (i = 1; i <= m; i++) {
    cin >> l;
    bike.push_back(l);
  }
  sort(st.begin(), st.end());
  sort(bike.begin(), bike.end());
  b = a;
  long long my, pen = 0, ans = 0;
  l = 0, k = min(m, n);
  while (l <= k) {
    mid = (l + k) / 2;
    j = 0;
    b = a;
    my = 0;
    int cnt = 0;
    j = mid - 1;
    for (i = st.size() - 1; i >= 0 && j >= 0; i--, j--) {
      if (st[i] >= bike[j]) {
        cnt++;
        my += bike[j];
        continue;
      }
      if ((bike[j] - st[i]) > b) {
        break;
      }
      cnt++;
      b -= (bike[j] - st[i]);
      my += st[i];
    }
    if (cnt == mid) {
      ans = mid;
      l = mid + 1;
      if (my < b)
        pen = 0;
      else
        pen = my - b;
    } else
      k = mid - 1;
  }
  cout << ans << " " << pen << endl;
}
