n = int(input())
S = set([int(i) for i in input().split()])
q = int(input())
T = set([int(i) for i in input().split()])
print(len( S & T )) n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i S = set([int(i) for i in input().split()]) S set([int(i) for i in input().split()]) set [int(i) for i in input().split()] q = int(input()) q int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i T = set([int(i) for i in input().split()]) T set([int(i) for i in input().split()]) set [int(i) for i in input().split()] print(len( S & T )) print len( S & T ) len S & T S T n = int(input()) int(input()) n 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 q = int(input()) int(input()) q
n = int(input())
S = set([int(i) for i in input().split()])
q = int(input())
T = set([int(i) for i in input().split()])
print(len( S & T ))