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