import sys input = sys.stdin.readline N=int(input()) x=int(input()) A0=list(map(int,input().split())) y=int(input()) B0=list(map(int,input().split())) A0.sort(reverse=True) B0.sort() A=A0[:] while len(A)b: ind=j if ind==-1: k=A.pop() else: ANS2+=1 k=A.pop(ind) print(max(ANS,ANS2))