n = int(input())
s = input().split()
q = int(input())
t = input().split()
c = 0

for i in t:
    for j in s:
        if i == j:
            c += 1
            break
print(c)
 n = int(input()) n int(input()) int input() input s = input().split() s input().split() ().split () input split q = int(input()) q int(input()) int input() input t = input().split() t input().split() ().split () input split c = 0 c 0 for i in t:
    for j in s:
        if i == j:
            c += 1
            break i t for j in s:
        if i == j:
            c += 1
            break j s if i == j:
            c += 1
            break i == j i j c += 1 c 1 break print(c) print c n = int(input()) int(input()) n s = input().split() input().split() s c = 0 0 c q = int(input()) int(input()) q c += 1 1 c t = input().split() input().split() t
n = int(input())
s = input().split()
q = int(input())
t = input().split()
c = 0

for i in t:
    for j in s:
        if i == j:
            c += 1
            break
print(c)

