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

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

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

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

ans = 0
for t in T:
    if linear_search(S, n, t):
        ans += 1
print(ans)
