n = input()
S = raw_input().split()
q = input()
T = raw_input().split()

s = 0
for i in T:
    if i in S:
        s+=1
print s n = input() n input() input S = raw_input().split() S raw_input().split() ().split () raw_input split q = input() q input() input T = raw_input().split() T raw_input().split() ().split () raw_input split s = 0 s 0 for i in T:
    if i in S:
        s+=1 i T if i in S:
        s+=1 i in S i S s+=1 s 1 print S = raw_input().split() raw_input().split() S s+=1 1 s n = input() input() n s = 0 0 s T = raw_input().split() raw_input().split() T q = input() input() q
n = input()
S = raw_input().split()
q = input()
T = raw_input().split()

s = 0
for i in T:
    if i in S:
        s+=1
print s