n = int(input())
S = list(map(int,input().split()))
p = int(input())
T = list(map(int,input().split()))
count = 0

for i in T:
    for j in S:
        if i == j:
            count += 1
            break
print(count)
 n = int(input()) n int(input()) int input() input S = list(map(int,input().split())) S list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split p = int(input()) p int(input()) int input() input T = list(map(int,input().split())) T list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split count = 0 count 0 for i in T:
    for j in S:
        if i == j:
            count += 1
            break i T for j in S:
        if i == j:
            count += 1
            break j S if i == j:
            count += 1
            break i == j i j count += 1 count 1 break print(count) print count p = int(input()) int(input()) p count += 1 1 count n = int(input()) int(input()) n T = list(map(int,input().split())) list(map(int,input().split())) T S = list(map(int,input().split())) list(map(int,input().split())) S count = 0 0 count
n = int(input())
S = list(map(int,input().split()))
p = int(input())
T = list(map(int,input().split()))
count = 0

for i in T:
    for j in S:
        if i == j:
            count += 1
            break
print(count)

