n = int(input())
S = [int(s) for s in str(input()).split()]
q = int(input())
T = [int(t) for t in str(input()).split()]
#print(n, S, q, T)

print(len([i for i in T if i in S])) n = int(input()) n int(input()) int input() input int(s) for s in str(input()).split() for s in str(input()).split() s str(input()).split() (input()).split (input()) str input() input split for s in str(input()).split() int(s) int s S = [int(s) for s in str(input()).split()] S [int(s) for s in str(input()).split()] q = int(input()) q int(input()) int input() input int(t) for t in str(input()).split() for t in str(input()).split() t str(input()).split() (input()).split (input()) str input() input split for t in str(input()).split() int(t) int t T = [int(t) for t in str(input()).split()] T [int(t) for t in str(input()).split()] i for i in T if i in S for i in T if i in S i T i in S i S if i in S i print(len([i for i in T if i in S])) print len([i for i in T if i in S]) len [i for i in T if i in S] T = [int(t) for t in str(input()).split()] [int(t) for t in str(input()).split()] T q = int(input()) int(input()) q n = int(input()) int(input()) n S = [int(s) for s in str(input()).split()] [int(s) for s in str(input()).split()] S
n = int(input())
S = [int(s) for s in str(input()).split()]
q = int(input())
T = [int(t) for t in str(input()).split()]
#print(n, S, q, T)

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