#include <bits/stdc++.h>
using namespace std;
int p[100100], b[100100];
void solve() {
  int n, m, a, r, s, left, right, y, x, j;
  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(p, p + m);
  sort(b, b + n);
  left = 0, right = n;
  while (left <= right) {
    int mid = (left + right) / 2;
    int tmp = a;
    j = 0, x = 0, y = 0;
    for (int i = mid; i < n; i++) {
      if (b[i] < p[j]) {
        if (b[i] + tmp < p[j])
          break;
        else
          tmp -= (p[j] - b[i]);
      }
      y += min(p[j], b[i]);
      j++;
      x++;
      if (j == m) break;
    }
    if (n - mid == x) {
      r = x;
      s = max((y - tmp), 0);
      right = mid - 1;
    } else
      left = mid + 1;
  }
  cout << r << " " << s << endl;
}
int main() { solve(); }
