n = int(input())
str = input().split(" ")
S = [int(str[i]) for i in range(n)]
q = int(input())
str = input().split(" ")
T = [int(str[i]) for i in range(q)]

S_set = set(S)
S = list(S_set)
T.sort()

result = 0

for s in S:
    for t in T:
        if s == t:
            result += 1
            break
        

print(result)
        


 n = int(input()) n int(input()) int input() input str = input().split(" ") str input().split(" ") ().split () input split " " int(str[i]) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(str[i]) int str[i] str i S = [int(str[i]) for i in range(n)] S [int(str[i]) for i in range(n)] q = int(input()) q int(input()) int input() input str = input().split(" ") str input().split(" ") ().split () input split " " int(str[i]) for i in range(q) for i in range(q) i range(q) range q for i in range(q) int(str[i]) int str[i] str i T = [int(str[i]) for i in range(q)] T [int(str[i]) for i in range(q)] S_set = set(S) S_set set(S) set S S = list(S_set) S list(S_set) list S_set T.sort() T.sort T sort result = 0 result 0 for s in S:
    for t in T:
        if s == t:
            result += 1
            break
         s S for t in T:
        if s == t:
            result += 1
            break
         t T if s == t:
            result += 1
            break
         s == t s t result += 1 result 1 break print(result) print result q = int(input()) int(input()) q S = [int(str[i]) for i in range(n)] [int(str[i]) for i in range(n)] S S = list(S_set) list(S_set) S n = int(input()) int(input()) n str = input().split(" ") input().split(" ") str T = [int(str[i]) for i in range(q)] [int(str[i]) for i in range(q)] T str = input().split(" ") input().split(" ") str result += 1 1 result S_set = set(S) set(S) S_set result = 0 0 result
n = int(input())
str = input().split(" ")
S = [int(str[i]) for i in range(n)]
q = int(input())
str = input().split(" ")
T = [int(str[i]) for i in range(q)]

S_set = set(S)
S = list(S_set)
T.sort()

result = 0

for s in S:
    for t in T:
        if s == t:
            result += 1
            break
        

print(result)
        



