#include <iostream>
#include <algorithm> // for sort, mainly
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <array>
#include <string>
#include <cstdio>
#include <iterator>
#include <unordered_set>
#include <cstdint> // for int64_t, int32_t, etc
#include <queue>
#include <stack>
#include <deque>
#include <numeric> // gcd, lcm
#include <fstream>
#include <bitset> // for bitset
#include <iomanip>
#include <cassert> // for set with custom ordering
#include <type_traits> // for set with custom ordering
#include <utility> // for swap, forward, etc
using namespace std;
#pragma GCC optimize("O2")
// #pragma GCC optimize("O1","O2","O3","Ofast","unroll-loops")
//#pragma GCC target("sse","sse2","sse3","sse4.1","sse4.2","avx","avx2","fma")
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cout << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); }
#ifdef LOCAL
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
/*
*
* notes:
*
* int64_t
* stoi(string s) -> string to int
* to_string() -> int (or else) to string
*
* vector declaration:
* vector<ll> v(n, 0)
* vector<vector<ll>> v(n, vector<ll>(n, 0));
*
* {if statement} ? {truth value} : {false value}
*
* set lower bound/upper bound:
* // . . . m1 . . . d . . . . m2
* auto m1_it = b.lower_bound(d);
* advance(m1_it, -1);
* m1 = *m1_it;
* m2 = *b.upper_bound(d);
*
* #ifdef LOCAL
* freopen("in.txt","r",stdin);
* freopen("out.txt","w",stdout);
* #endif
*
* constexpr auto lcm(auto x, auto... xs)
* {
* return ((x = std::lcm(x, xs)), ...);
* }
*
* std::gcd(int a, int b)
*
* cout << setprecision(n);
*
* set with custom ordering
* set<ll, decltype(&cmp)> qu(cmp);
*
*/
typedef int64_t ll;
void refill(multiset<ll> &q, vector<ll> &s ) {
for(const auto & x : s) {
q.insert(x);
}
}
void cerrms(multiset<ll> &q) {
for(const auto & x : q) {
cerr << x << " ";
}
}
void solve() {
ll a, b, n;
cin >> a >> b >> n;
vector<ll> f(n, 0);
vector<ll> s(n, 0);
for(ll i = 0; i < n; i++) {
cin >> f[i];
}
for(ll i = 0; i < n; i++) {
cin >> s[i];
}
//cerr << "\ns=" << s;
multiset<ll> q;
refill(q, s);
// best score:
// best of first day goes with the worst of second day
// worst score:
// best of first day goes with best of second day
// best doesn't go with the exact best
// the largest number such that its score is smaller than ours
// same for worst
// best placement
sort(f.begin(), f.end());
ll worse = 0; // or equal
for(ll i = 0; i <= n - 1; i++) {
//cerr << "\nf[" << i << "]=" << f[i];
ll most = a + b - f[i];
// the most score this competitor needs to have a worse or equal score
//cerr << "\nmost=" << most;
auto get = q.upper_bound(most);
//cerr << "\ngetval=" << *get;
if(get == q.begin()) {
continue;
}else{
advance(get, -1);
}
q.erase(get);
worse++;
}
//cerr << "\nworse=" << worse;
cout << n - worse + 1 << " ";
ll better = 0;
q.clear();
refill(q, s);
// worst placement:
// how many can have a strictly greater score than him?
for(ll i = n-1 ; i >= 0; i--) {
// keressuk a legkisebbet, hogy meg nagyobb legyen, mint a + b
//cerr << "\n\nf[" << i << "]=" << f[i];
ll mn = a + b - f[i];
//cerr << "\nmost=" << mn;
auto get = q.upper_bound(mn);
if(get == q.end()) {
//cerr << "\ncan't :'(";
continue;
}
//cerr << "\ngetval=" << *get;
//cerr << "\nq=";
//cerrms(q);
q.erase(get);
//cerr << "\nq (after delete)=";
//cerrms(q);
better++;
}
//cerr << "\nbetter=" << better;
cout << better + 1;
}
int main()
{
std::ios_base::sync_with_stdio(false);
//cin.tie(nullptr);
//cout.tie(nullptr);
solve();
return 0;
}