#pragma once #include #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector VI; typedef pair P; typedef tuple t3; #define rep(a,n) for(int a = 0;a < n;a++) #define repi(a,b,n) for(int a = b;a < n;a++) const ull mod = 1000000007; int main(void) { ll n; cin >> n; vector as(n+1); vector bs(n+1); vector ds(n); rep(i, n + 1) cin >> as[i]; rep(i, n + 1) cin >> bs[i]; rep(i, n) cin >> ds[i]; vector p(n); int a = 0; int b = 0; rep(i, n) { if (as[a + 1] + bs[b] < as[a] + bs[b + 1]) { b++; } else { a++; } p[i] = as[a] + bs[b]; } sort(ds.begin(), ds.end(), std::greater()); int sum = 0; rep(i, n) { auto l = lower_bound(ds.begin(), ds.end(), p[i], std::greater()); if (l != ds.end()) { sum++; ds.erase(l); } } cout << sum << endl; return 0; }