N = int(input()) l = list(map(int,input().split())) M = int(input()) s = list(map(int,input().split())) w = [(i,0) for i in l] b = [(i,1) for i in s] l = w + b l.sort(reverse = True) i = 0 ans = 0 while i < len(l): flag = l[i][1] ans += 1 while i < len(l) and l[i][1] == flag: i += 1 print(ans)