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