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

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

count = 0
for t in T:
    for s in S:
        if t == s:
            count += 1
            break
print(count)
