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) M = len(D) left = 0 right = N+1 def doDP(num): dp = [[False for _ in range(N+1)] for _ in range(N+1)] count = 0 for i in range(1,num+1): if A[i]+B[0] >= D[i-1]: dp[i][0] = True else: break for j in range(1,num+1): if A[0]+B[j] >= D[j-1]: dp[0][j] = True else: break for i in range(N): for j in range(N-i): if (D[i+j-1] <= A[i]+B[j]) and (dp[i-1][j] or dp[i][j-1]): dp[i][j] = True count = max(count,i+j+1) return count while (right-left) > 1: mid = (right+left)//2 c = doDP(mid) if left < c: left = mid else: right = mid print(left)