n1 = int(input())
a1 = [int(x) for x in input().split()]
n2 = int(input())
a2 = [int(x) for x in input().split()]

res = set()

cnt = 0

for i in range(n1) :
    for j in range(n2) :
        if a1[i] == a2[j] :
            res.add(a1[i])
            
print(len(res))
             n1 = int(input()) n1 int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a1 = [int(x) for x in input().split()] a1 [int(x) for x in input().split()] n2 = int(input()) n2 int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a2 = [int(x) for x in input().split()] a2 [int(x) for x in input().split()] res = set() res set() set cnt = 0 cnt 0 for i in range(n1) :
    for j in range(n2) :
        if a1[i] == a2[j] :
            res.add(a1[i])
             i range(n1) range n1 for j in range(n2) :
        if a1[i] == a2[j] :
            res.add(a1[i])
             j range(n2) range n2 if a1[i] == a2[j] :
            res.add(a1[i])
             a1[i] == a2[j] a1[i] a1 i a2[j] a2 j res.add(a1[i]) res.add res add a1[i] a1 i print(len(res)) print len(res) len res n2 = int(input()) int(input()) n2 a2 = [int(x) for x in input().split()] [int(x) for x in input().split()] a2 n1 = int(input()) int(input()) n1 res = set() set() res cnt = 0 0 cnt a1 = [int(x) for x in input().split()] [int(x) for x in input().split()] a1
n1 = int(input())
a1 = [int(x) for x in input().split()]
n2 = int(input())
a2 = [int(x) for x in input().split()]

res = set()

cnt = 0

for i in range(n1) :
    for j in range(n2) :
        if a1[i] == a2[j] :
            res.add(a1[i])
            
print(len(res))
            
