
n = int(input())
S = {int(s) for s in input().split()}

q = int(input())
T = {int(t) for t in input().split()}

cnt = sum(t in S for t in T)

print(cnt) n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s S = {int(s) for s in input().split()} S 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 cnt = sum(t in S for t in T) cnt sum(t in S for t in T) sum t in S t S print(cnt) print cnt n = int(input()) int(input()) n T = {int(t) for t in input().split()} T q = int(input()) int(input()) q cnt = sum(t in S for t in T) sum(t in S for t in T) cnt S = {int(s) for s in input().split()} S

n = int(input())
S = {int(s) for s in input().split()}

q = int(input())
T = {int(t) for t in input().split()}

cnt = sum(t in S for t in T)

print(cnt)