#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int lcm(int x, int y) { return x * y / gcd(x, y); }
int n, m, a, t;
int main() {
  vector<int> b, p;
  scanf("%d%d%d", &n, &m, &a);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &t);
    b.push_back(t);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &t);
    p.push_back(t);
  }
  sort(b.begin(), b.end());
  sort(p.begin(), p.end());
  int left = 1, right = n, r = 0;
  while (left <= right) {
    int mid = (left + right) / 2;
    bool possible = true;
    int psum = 0, bsum = 0, m = a;
    for (int i = 0; i < mid; ++i) {
      if (b[n - mid + i] + m >= p[i]) {
        if (b[n - mid + i] >= p[i])
          continue;
        else
          m = m - (p[i] - b[n - mid + i]);
      } else {
        possible = false;
        break;
      }
    }
    if (possible) {
      left = mid + 1;
      r = mid;
    } else {
      right = mid - 1;
    }
  }
  int s = 0;
  for (int i = 0; i < r; ++i) s += p[i];
  s = max(0, s - a);
  printf("%d %d\n", r, s);
  return 0;
}
