n = int(input())
S = [int(i) for i in input().split(' ')]

q = int(input())
T = [int(i) for i in input().split(' ')]

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

print(result) n = int(input()) n int(input()) int input() input int(i) for i in input().split(' ') for i in input().split(' ') i input().split(' ') ().split () input split ' ' for i in input().split(' ') int(i) int i S = [int(i) for i in input().split(' ')] S [int(i) for i in input().split(' ')] q = int(input()) q int(input()) int input() input int(i) for i in input().split(' ') for i in input().split(' ') i input().split(' ') ().split () input split ' ' for i in input().split(' ') int(i) int i T = [int(i) for i in input().split(' ')] T [int(i) for i in input().split(' ')] result = 0 result 0 for t in T:
    for s in S:
        if t == s:
            result += 1
            break t T for s in S:
        if t == s:
            result += 1
            break s S if t == s:
            result += 1
            break t == s t s result += 1 result 1 break print(result) print result S = [int(i) for i in input().split(' ')] [int(i) for i in input().split(' ')] S T = [int(i) for i in input().split(' ')] [int(i) for i in input().split(' ')] T result += 1 1 result result = 0 0 result n = int(input()) int(input()) n q = int(input()) int(input()) q
n = int(input())
S = [int(i) for i in input().split(' ')]

q = int(input())
T = [int(i) for i in input().split(' ')]

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

print(result)
