n = input()
s = set(int(i) for i in input().split())
q = input()
t = set(int(i) for i in input().split())
print(len(t & s)) n = input() n input() input s = set(int(i) for i in input().split()) s set(int(i) for i in input().split()) set int(i) int i q = input() q input() input t = set(int(i) for i in input().split()) t set(int(i) for i in input().split()) set int(i) int i print(len(t & s)) print len(t & s) len t & s t s n = input() input() n q = input() input() q s = set(int(i) for i in input().split()) set(int(i) for i in input().split()) s t = set(int(i) for i in input().split()) set(int(i) for i in input().split()) t
n = input()
s = set(int(i) for i in input().split())
q = input()
t = set(int(i) for i in input().split())
print(len(t & s))