n =int(input())

S = list(map(int, input().split(' ')))

q = int(input())

T = list(map(int, input().split(' ')))

count = 0
for t in T:
    if t in S:
        count += 1
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 ' ' q = int(input()) q 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 t in T:
    if t in S:
        count += 1 t T if t in S:
        count += 1 t in S t S count += 1 count 1 print(count) print count S = list(map(int, input().split(' '))) list(map(int, input().split(' '))) S q = int(input()) int(input()) q n =int(input()) int(input()) n T = list(map(int, input().split(' '))) list(map(int, input().split(' '))) T count += 1 1 count count = 0 0 count
n =int(input())

S = list(map(int, input().split(' ')))

q = int(input())

T = list(map(int, input().split(' ')))

count = 0
for t in T:
    if t in S:
        count += 1
print(count)
