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