from collections import deque

def linersearch(A,n,key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True

n = int(input())
S = deque([int(x) for x in input().split()])
q = int(input())
T = [int(x) for x in input().split()]
ans = 0

for q in T:
    if linersearch(S,n,q):
        ans += 1

print(ans) from collections import deque def linersearch(A,n,key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True linersearch 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 if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True i == n i n A.pop() A.pop A pop return False False A.pop() A.pop A pop return True True A A n n key key 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 = deque([int(x) for x in input().split()]) S deque([int(x) for x in input().split()]) deque [int(x) for x in input().split()] q = int(input()) q 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 T = [int(x) for x in input().split()] T [int(x) for x in input().split()] ans = 0 ans 0 for q in T:
    if linersearch(S,n,q):
        ans += 1 q T if linersearch(S,n,q):
        ans += 1 linersearch(S,n,q) linersearch S n q ans += 1 ans 1 print(ans) print ans q = int(input()) int(input()) q def linersearch(A,n,key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True def linersearch(A,n,key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True linersearch ans = 0 0 ans T = [int(x) for x in input().split()] [int(x) for x in input().split()] T S = deque([int(x) for x in input().split()]) deque([int(x) for x in input().split()]) S n = int(input()) int(input()) n ans += 1 1 ans
from collections import deque

def linersearch(A,n,key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == n:
        A.pop()
        return False
    else:
        A.pop()
        return True

n = int(input())
S = deque([int(x) for x in input().split()])
q = int(input())
T = [int(x) for x in input().split()]
ans = 0

for q in T:
    if linersearch(S,n,q):
        ans += 1

print(ans)
