#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100002;
int N, M, r;
int b[MAX_N], p[MAX_N];
long long A, s;
pair<int, long long> check(int k) {
  pair<int, long long> ret;
  long long Cost = 0, sum = 0;
  ret.second = 0;
  if (k > M) {
    ret.first = 0;
    return ret;
  }
  for (int i = 1, j = k; i <= k; ++i, --j) {
    if (b[i] < p[j]) Cost += p[j] - b[i];
    sum += min(p[j], b[i]);
  }
  if (Cost <= A) {
    ret.first = 1;
    sum -= A - Cost;
    sum = max(sum, (long long)0);
    ret.second = sum;
  } else
    ret.first = 0;
  return ret;
}
int main() {
  cin >> N >> M >> A;
  for (int i = 1; i <= N; ++i) cin >> b[i];
  for (int j = 1; j <= M; ++j) cin >> p[j];
  sort(b + 1, b + N + 1);
  sort(p + 1, p + M + 1);
  for (int i = 1, j = N; i < j; ++i, --j) swap(b[i], b[j]);
  pair<int, long long> temp;
  for (int left = 1, right = N, m; left <= right;) {
    m = (left + right) / 2;
    temp = check(m);
    if (temp.first == 1)
      r = m, s = temp.second, left = m + 1;
    else
      right = m - 1;
  }
  cout << r << " " << s << "\n";
  return 0;
}
