#! python3
# linear_search.py

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

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

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(' ')] 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(' ')] c = 0 c 0 for t in T:
    for s in S:
        if t == s:
            c += 1
            break t T for s in S:
        if t == s:
            c += 1
            break s S if t == s:
            c += 1
            break t == s t s c += 1 c 1 break print(c) print c S = [int(x) for x in input().split(' ')] [int(x) for x in input().split(' ')] S c = 0 0 c n = int(input()) int(input()) n q = int(input()) int(input()) q c += 1 1 c T = [int(x) for x in input().split(' ')] [int(x) for x in input().split(' ')] T
#! python3
# linear_search.py

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

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

print(c)

