#!/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): nf = [ False ] * (i + 1) for j in range(i): if not f[j]: continue if a[j] + b[i - j] >= d[m - i]: nf[j] = True if a[j + 1] + b[i - j - 1] >= d[m - i]: nf[j + 1] = True f = nf ff = False for i in f: if i: ff = True if ff: ok = m else: ng = m print(ok)