input()
s=set(raw_input().split())
input()
t=set(raw_input().split())
print len(s&t) input() input s=set(raw_input().split()) s set(raw_input().split()) set raw_input().split() ().split () raw_input split input() input t=set(raw_input().split()) t set(raw_input().split()) set raw_input().split() ().split () raw_input split print len(s&t) len s&t s t s=set(raw_input().split()) set(raw_input().split()) s t=set(raw_input().split()) set(raw_input().split()) t
input()
s=set(raw_input().split())
input()
t=set(raw_input().split())
print len(s&t)