#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair pcc; typedef pair P; typedef tuple t3; #define rep(i,a) for(ll i = 0;i < a;i++) template void cmax(T& a, const T b){a=max(a,b);} const ll mod = 1e9+7; int main(void) { ll n; cin >> n; vector as(n+1); vector bs(n+1); vector ds(n); vector cs(n); rep(i,n+1) cin >> as[i]; rep(i,n+1) cin >> bs[i]; rep(i,n) cin >> ds[i]; ll a = 0; ll b = 0; rep(i,n){ ll sum1 = as[a+1] + bs[b]; ll sum2 = as[a] + bs[b+1]; if(sum1 >= sum2){ a++; } else{ b++; } cs[i] = max(sum1, sum2); } ll count = 0; int j = 0; sort(ds.begin(), ds.end(), std::greater()); for(int i = 0;i < n;i++){ if(ds[i] > cs[j]) continue; count++; j++; } cout << count << endl; return 0; }