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:
    for j in S:
        if i == j:
            match_count += 1
            break

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

print(str(match_count))

