n = int(input())
a = input()
s=list(map(int,a.split()))

q = int(input())
a = input()
t=list(map(int,a.split()))

i = 0
for it in t:
    if it in s:
        i = i+1
print(i) n = int(input()) n int(input()) int input() input a = input() a input() input s=list(map(int,a.split())) s list(map(int,a.split())) list map(int,a.split()) map int a.split() a.split a split q = int(input()) q int(input()) int input() input a = input() a input() input t=list(map(int,a.split())) t list(map(int,a.split())) list map(int,a.split()) map int a.split() a.split a split i = 0 i 0 for it in t:
    if it in s:
        i = i+1 it t if it in s:
        i = i+1 it in s it s i = i+1 i i+1 i 1 print(i) print i n = int(input()) int(input()) n q = int(input()) int(input()) q i = i+1 i+1 i t=list(map(int,a.split())) list(map(int,a.split())) t a = input() input() a a = input() input() a i = 0 0 i s=list(map(int,a.split())) list(map(int,a.split())) s
n = int(input())
a = input()
s=list(map(int,a.split()))

q = int(input())
a = input()
t=list(map(int,a.split()))

i = 0
for it in t:
    if it in s:
        i = i+1
print(i)