n = int(raw_input())
S = map(int, raw_input().split())
q = int(raw_input())
T = map(int, raw_input().split())

x = set(S) & set(T)
print len(x) n = int(raw_input()) n int(raw_input()) int raw_input() raw_input S = map(int, raw_input().split()) S map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split q = int(raw_input()) q int(raw_input()) int raw_input() raw_input T = map(int, raw_input().split()) T map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split x = set(S) & set(T) x set(S) & set(T) set(S) set S set(T) set T print len(x) len x S = map(int, raw_input().split()) map(int, raw_input().split()) S T = map(int, raw_input().split()) map(int, raw_input().split()) T n = int(raw_input()) int(raw_input()) n x = set(S) & set(T) set(S) & set(T) x q = int(raw_input()) int(raw_input()) q
n = int(raw_input())
S = map(int, raw_input().split())
q = int(raw_input())
T = map(int, raw_input().split())

x = set(S) & set(T)
print len(x)