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 check(m): dp[0][0] = 1 for i in range(N + 1): for j in range(N + 1): if i + j == 0: continue if i + j > m: break flag = 0 if i: flag |= dp[i-1][j] if j: flag |= dp[i][j-1] dp[i][j] = int(flag & (D[i + j + N - 1 - m] <= A[i] + B[j])) flag = 0 for i in range(m + 1): flag |= dp[i][m - i] for i in range(N + 1): for j in range(N + 1): if i + j == 0: continue if i + j > m: break dp[i][j] = 0 return flag if check(N): print(N) exit() yes = 0 no = N while no - yes != 1: mid = (yes + no)//2 if check(mid): yes = mid else: no = mid print(yes)