#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
long long b[100005], p[100005];
priority_queue<long long, vector<long long>, greater<long long> > pq;
long long n, m, a;
long long ans, mn;
bool check(int k) {
  if (k > m) return false;
  long long aa = a;
  for (int i = k, j = n; i >= 1; i--, j--) {
    long long req = max(0LL, p[i] - b[j]);
    if (req > aa) return false;
    aa = max(0LL, aa - req);
  }
  return true;
}
int main() {
  cin >> n >> m >> a;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> p[i];
  }
  sort(b + 1, b + n + 1);
  sort(p + 1, p + m + 1);
  long long lo = 0;
  long long hi = n;
  long long ans = 0;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (check(mid)) {
      ans = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  long long sum = 0;
  for (int i = 1; i <= ans; i++) sum += p[i];
  sum = max(0LL, sum - a);
  cout << ans << " " << sum;
}
