n = int(input())
s = input().split()
q = int(input())
t = input().split()
res = 0
for i in t:
    if i in s:
        res +=1
print(res) n = int(input()) n int(input()) int input() input s = input().split() s input().split() ().split () input split q = int(input()) q int(input()) int input() input t = input().split() t input().split() ().split () input split res = 0 res 0 for i in t:
    if i in s:
        res +=1 i t if i in s:
        res +=1 i in s i s res +=1 res 1 print(res) print res res = 0 0 res n = int(input()) int(input()) n s = input().split() input().split() s res +=1 1 res t = input().split() input().split() t q = int(input()) int(input()) q
n = int(input())
s = input().split()
q = int(input())
t = input().split()
res = 0
for i in t:
    if i in s:
        res +=1
print(res)
