#!/usr/bin/env pypy3 n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) d = list(map(int, input().split())) d.sort() ok = 0 ng = n + 1 while ng - ok > 1: m = (ok + ng) // 2 f = [ True ] for i in range(1, m + 1): f = [ a[j] + b[i - j] >= d[m - i] and (j < i and f[j] or j > 0 and f[j - 1]) for j in range(i + 1) ] if any(f): ok = m else: ng = m print(ok)