n = int(input())
S = [int(t) for t in input().split()]
q = int(input())
T = [int(t) for t in input().split()]
assert n == len(S) and q == len(T)

print(sum(1 for t in T if t in S)) n = int(input()) n int(input()) int input() input int(t) for t in input().split() for t in input().split() t input().split() ().split () input split for t in input().split() int(t) int t S = [int(t) for t in input().split()] S [int(t) for t in input().split()] q = int(input()) q int(input()) int input() input int(t) for t in input().split() for t in input().split() t input().split() ().split () input split for t in input().split() int(t) int t T = [int(t) for t in input().split()] T [int(t) for t in input().split()] assert n == len(S) and q == len(T) n == len(S) and q == len(T) n == len(S) n len(S) len S q == len(T) q len(T) len T print(sum(1 for t in T if t in S)) print sum(1 for t in T if t in S) sum 1 T = [int(t) for t in input().split()] [int(t) for t in input().split()] T S = [int(t) for t in input().split()] [int(t) for t in input().split()] S n = int(input()) int(input()) n q = int(input()) int(input()) q
n = int(input())
S = [int(t) for t in input().split()]
q = int(input())
T = [int(t) for t in input().split()]
assert n == len(S) and q == len(T)

print(sum(1 for t in T if t in S))
