n = int(input())
S = [int(i) for i in input().split()]
q = int(input())
T = [int(i) for i in input().split()]
cnt = 0
for T in T:
    if T in S:
        cnt += 1
print(cnt)  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()] cnt = 0 cnt 0 for T in T:
    if T in S:
        cnt += 1 T T if T in S:
        cnt += 1 T in S T S cnt += 1 cnt 1 print(cnt) print cnt q = int(input()) int(input()) q cnt += 1 1 cnt n = int(input()) int(input()) n T = [int(i) for i in input().split()] [int(i) for i in input().split()] T cnt = 0 0 cnt S = [int(i) for i in input().split()] [int(i) for i in input().split()] S
n = int(input())
S = [int(i) for i in input().split()]
q = int(input())
T = [int(i) for i in input().split()]
cnt = 0
for T in T:
    if T in S:
        cnt += 1
print(cnt) 