n = int(input())
S = list(map(int, input().split()))

q = int(input())
T = list(map(int, input().split()))

print(len([t for t in T if t in S])) n = int(input()) n int(input()) int input() input S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = list(map(int, input().split())) T list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split t for t in T if t in S for t in T if t in S t T t in S t S if t in S t print(len([t for t in T if t in S])) print len([t for t in T if t in S]) len [t for t in T if t in S] n = int(input()) int(input()) n S = list(map(int, input().split())) list(map(int, input().split())) S T = list(map(int, input().split())) list(map(int, input().split())) T q = int(input()) int(input()) q
n = int(input())
S = list(map(int, input().split()))

q = int(input())
T = list(map(int, input().split()))

print(len([t for t in T if t in S]))
