a = [raw_input() for i in range(4)]
print len(set(a[1].split())&set(a[3].split()))


fd60e3262d1696466f1eb213639308b8d765a71d
a = [raw_input() for i in range(4)]
print len(set(a[1].split())&set(a[3].split()))

