n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] d = [int(i) for i in input().split()] d.sort() n1 = n+1 es = [[] for i in range(n1)] for i in range(n1): for j in range(n1): p = i + j if p <= n: es[p].append(i*n1+j) m = [0] * (n1*n1) for p in range(n,0,-1): for e in es[p]: i = e // n1 j = e % n1 s = m[e] r = a[i] + b[j] if s < n and d[s] <= r: s += 1 u = e - 1 if u >= 0 and s > m[u]: m[u] = s v = e - n1 if v >= 0 and s > m[v]: m[v] = s print(m[0])