N = int(input())
S = list(map(int, input().split()))
Q = int(input())
T = list(map(int, input().split()))

match_count = 0
for i in T:
    if i in S:
        match_count += 1

print(str(match_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 match_count = 0 match_count 0 for i in T:
    if i in S:
        match_count += 1 i T if i in S:
        match_count += 1 i in S i S match_count += 1 match_count 1 print(str(match_count)) print str(match_count) str match_count T = list(map(int, input().split())) list(map(int, input().split())) T N = int(input()) int(input()) N S = list(map(int, input().split())) list(map(int, input().split())) S match_count = 0 0 match_count match_count += 1 1 match_count Q = int(input()) int(input()) Q
N = int(input())
S = list(map(int, input().split()))
Q = int(input())
T = list(map(int, input().split()))

match_count = 0
for i in T:
    if i in S:
        match_count += 1

print(str(match_count))
