N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) D = list(map(int, input().split())) D.sort(reverse=True) dp = [[0] * (N + 1) for _ in range(N + 1)] def C(x): # k問とけるか判定 k = N - x solve = 1 while k < N: for i in range(solve + 1): j = solve - i val = 0 if i: val = max(val, dp[i-1][j] + (A[i]+B[j] >= D[k])) if j: val = max(val, dp[i][j-1] + (A[i]+B[j] >= D[k])) dp[i][j] = val solve += 1 k += 1 res = max(dp[i][x - i] for i in range(x + 1)) return res == x l = -1 r = N + 1 while (r - l) > 1: m = (r + l) // 2 if C(m): l = m else: r = m print(l)