N = int(input())
S = [int(x) for x in input().split()]
T = int(input())
Q = [int(x) for x in input().split()]

c = 0

def seach(A, n, key):
    i = 0
    A = A + [key]
    while A[i] != key:
        i += 1
    return i != n

for q in Q:
    if seach(S, N, q):
        c += 1
        
print(c) N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x S = [int(x) for x in input().split()] S [int(x) for x in input().split()] T = int(input()) T int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x Q = [int(x) for x in input().split()] Q [int(x) for x in input().split()] c = 0 c 0 def seach(A, n, key):
    i = 0
    A = A + [key]
    while A[i] != key:
        i += 1
    return i != n seach i = 0 i 0 A = A + [key] A A + [key] A [key] key while A[i] != key:
        i += 1
     A[i] != key A[i] A i key i += 1 i 1 return i != n i != n i n A A n n key key for q in Q:
    if seach(S, N, q):
        c += 1
         q Q if seach(S, N, q):
        c += 1
         seach(S, N, q) seach S N q c += 1 c 1 print(c) print c N = int(input()) int(input()) N T = int(input()) int(input()) T c = 0 0 c c += 1 1 c S = [int(x) for x in input().split()] [int(x) for x in input().split()] S Q = [int(x) for x in input().split()] [int(x) for x in input().split()] Q def seach(A, n, key):
    i = 0
    A = A + [key]
    while A[i] != key:
        i += 1
    return i != n def seach(A, n, key):
    i = 0
    A = A + [key]
    while A[i] != key:
        i += 1
    return i != n seach
N = int(input())
S = [int(x) for x in input().split()]
T = int(input())
Q = [int(x) for x in input().split()]

c = 0

def seach(A, n, key):
    i = 0
    A = A + [key]
    while A[i] != key:
        i += 1
    return i != n

for q in Q:
    if seach(S, N, q):
        c += 1
        
print(c)
