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

print(count)

