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


def linearSearch(A, n, key):
    i = 0
    A.append(key) # ??????
    while A[i] != key:
        i += 1
    A.pop()
    return i != n

count = 0

for i in range(q):
    if linearSearch(S, n, T[i]):
        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 def linearSearch(A, n, key):
    i = 0
    A.append(key) # ??????
    while A[i] != key:
        i += 1
    A.pop()
    return i != n linearSearch i = 0 i 0 A.append(key) A.append A append key while A[i] != key:
        i += 1
     A[i] != key A[i] A i key i += 1 i 1 A.pop() A.pop A pop return i != n i != n i n A A n n key key count = 0 count 0 for i in range(q):
    if linearSearch(S, n, T[i]):
        count += 1 i range(q) range q if linearSearch(S, n, T[i]):
        count += 1 linearSearch(S, n, T[i]) linearSearch S n T[i] T i count += 1 count 1 print(count) print count n = int(input()) int(input()) n count = 0 0 count q = int(input()) int(input()) q T = list(map(int, input().split())) list(map(int, input().split())) T def linearSearch(A, n, key):
    i = 0
    A.append(key) # ??????
    while A[i] != key:
        i += 1
    A.pop()
    return i != n def linearSearch(A, n, key):
    i = 0
    A.append(key) # ??????
    while A[i] != key:
        i += 1
    A.pop()
    return i != n linearSearch S = list(map(int, input().split())) list(map(int, input().split())) S count += 1 1 count
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))


def linearSearch(A, n, key):
    i = 0
    A.append(key) # ??????
    while A[i] != key:
        i += 1
    A.pop()
    return i != n

count = 0

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

print(count)