n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

count = 0

for i in range(q):
    for j in range(n):
        if T[i] == S[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 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 i in range(q):
    for j in range(n):
        if T[i] == S[j]:
            count += 1
            break i range(q) range q for j in range(n):
        if T[i] == S[j]:
            count += 1
            break j range(n) range n if T[i] == S[j]:
            count += 1
            break T[i] == S[j] T[i] T i S[j] S j count += 1 count 1 break print(count) print count S = list(map(int, input().split())) list(map(int, input().split())) S count = 0 0 count n = int(input()) int(input()) n count += 1 1 count T = list(map(int, input().split())) list(map(int, input().split())) T q = int(input()) int(input()) q
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

count = 0

for i in range(q):
    for j in range(n):
        if T[i] == S[j]:
            count += 1
            break

print(count)


