n = input()
s = input().split()
q = input()
t = input().split()

ans = 0
for c1 in t:
    for c2 in s:
        if c1 == c2:
            ans += 1
            break

print(ans) n = input() n input() input s = input().split() s input().split() ().split () input split q = input() q input() input t = input().split() t input().split() ().split () input split ans = 0 ans 0 for c1 in t:
    for c2 in s:
        if c1 == c2:
            ans += 1
            break c1 t for c2 in s:
        if c1 == c2:
            ans += 1
            break c2 s if c1 == c2:
            ans += 1
            break c1 == c2 c1 c2 ans += 1 ans 1 break print(ans) print ans ans += 1 1 ans q = input() input() q n = input() input() n t = input().split() input().split() t ans = 0 0 ans s = input().split() input().split() s
n = input()
s = input().split()
q = input()
t = input().split()

ans = 0
for c1 in t:
    for c2 in s:
        if c1 == c2:
            ans += 1
            break

print(ans)