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

ans = 0


for i in range(q):
    key = T[i]
    for j in range(n):
        if key == S[j]:
            ans += 1
            break
        else:
            continue

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

ans = 0


for i in range(q):
    key = T[i]
    for j in range(n):
        if key == S[j]:
            ans += 1
            break
        else:
            continue

print(ans)
