import numpy as np import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(input()) a = np.flipud(np.array(readline().split(),np.int32)) b = np.flipud(np.array(readline().split(),np.int32)) d = np.array(readline().split(),np.int32) d.sort() dp = np.zeros((3003, 3003), dtype=int) for i in range(n+1): for j in range(n+1): #print(i, j) if i > 0: dp[i][j] = max(dp[i][j], dp[i-1][j]) if j > 0: dp[i][j] = max(dp[i][j], dp[i][j-1]) if dp[i][j] == n: continue if i == n and j == n: continue if a[i] + b[j] >= d[dp[i][j]]: dp[i][j] += 1 print(dp[n][n])