input()
li1 = [int(x) for x in list(input().split())]
input()
li2 = [int(x) for x in list(input().split())]

counter = 0
for i in li2:
    if i in li1:
        counter += 1
print(counter)
 input() input int(x) for x in list(input().split()) for x in list(input().split()) x list(input().split()) list input().split() ().split () input split for x in list(input().split()) int(x) int x li1 = [int(x) for x in list(input().split())] li1 [int(x) for x in list(input().split())] input() input int(x) for x in list(input().split()) for x in list(input().split()) x list(input().split()) list input().split() ().split () input split for x in list(input().split()) int(x) int x li2 = [int(x) for x in list(input().split())] li2 [int(x) for x in list(input().split())] counter = 0 counter 0 for i in li2:
    if i in li1:
        counter += 1 i li2 if i in li1:
        counter += 1 i in li1 i li1 counter += 1 counter 1 print(counter) print counter li1 = [int(x) for x in list(input().split())] [int(x) for x in list(input().split())] li1 li2 = [int(x) for x in list(input().split())] [int(x) for x in list(input().split())] li2 counter = 0 0 counter counter += 1 1 counter
input()
li1 = [int(x) for x in list(input().split())]
input()
li2 = [int(x) for x in list(input().split())]

counter = 0
for i in li2:
    if i in li1:
        counter += 1
print(counter)

