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

print(sum([t in S for t in T])) n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s S = [int(s) for s in input().split()] S [int(s) for s in input().split()] q = int(input()) q int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s T = [int(s) for s in input().split()] T [int(s) for s in input().split()] t in S for t in T for t in T t T for t in T t in S t S print(sum([t in S for t in T])) print sum([t in S for t in T]) sum [t in S for t in T] q = int(input()) int(input()) q T = [int(s) for s in input().split()] [int(s) for s in input().split()] T n = int(input()) int(input()) n S = [int(s) for s in input().split()] [int(s) for s in input().split()] S
n = int(input())
S = [int(s) for s in input().split()]
q = int(input())
T = [int(s) for s in input().split()]

print(sum([t in S for t in T]))