import java.util.*; public class Main { static int[] aArr; static int[] bArr; static int[] dArr; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); aArr = new int[n + 1]; bArr = new int[n + 1]; dArr = new int[n]; for (int i = 0; i <= n; i++) { aArr[i] = sc.nextInt(); } for (int i = 0; i <= n; i++) { bArr[i] = sc.nextInt(); } for (int i = 0; i < n; i++) { dArr[i] = sc.nextInt(); } Arrays.sort(dArr); int left = 0; int right = n + 1; while (right - left > 1) { int m = (left + right) / 2; boolean[][] dp = new boolean[m + 1][m + 1]; boolean[][] used = new boolean[m + 1][m + 1]; boolean flag = false; for (int i = 0; i <= m; i++) { if (dfw(m, i, m - i, dp, used)) { flag = true; break; } } if (flag) { left = m; } else { right = m; } } System.out.println(left); } static boolean dfw(int total, int left, int right, boolean[][] dp, boolean[][] used) { if (left < 0 || right < 0) { return false; } if (left + right == 0) { return true; } if (used[left][right]) { return dp[left][right]; } used[left][right] = true; int idx = total - left - right; return dp[left][right] = (dArr[idx] <= aArr[left] + bArr[right] && (dfw(total, left - 1, right, dp, used) || dfw(total, left, right - 1, dp, used))); } }