import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop; void main() { auto N = readln.chomp.to!int; auto A = readln.split.map!(to!long).array; auto B = readln.split.map!(to!long).array; auto D = readln.split.map!(to!long).array; D.sort!"a > b"; auto C = new long[](N); for (int i = 0, j = 0, k = -1; k < N; ++k) { if (i + j > 0) C[k] = A[i] + B[j]; if (i == N) ++j; else if (j == N) ++i; else if (A[i] + B[j+1] >= A[i+1] + B[j]) ++j; else ++i; } int ans = 0; int hi = N + 1; int lo = 0; while (hi - lo > 1) { int mid = (hi + lo) / 2; if (mid.iota.map!(i => C[i] >= D[N-mid+i]).all) { lo = mid; } else { hi = mid; } } lo.writeln; }