S_len = int(input().rstrip())
S = input().rstrip().split(" ")
T_len = int(input().rstrip())
T = input().rstrip().split(" ")

cnt = 0
for t in T:
    cnt += t in S
print(cnt)
 S_len = int(input().rstrip()) S_len int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip S = input().rstrip().split(" ") S input().rstrip().split(" ") ().rstrip().split ().rstrip() ().rstrip () input rstrip split " " T_len = int(input().rstrip()) T_len int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip T = input().rstrip().split(" ") T input().rstrip().split(" ") ().rstrip().split ().rstrip() ().rstrip () input rstrip split " " cnt = 0 cnt 0 for t in T:
    cnt += t in S t T cnt += t in S cnt t in S t S print(cnt) print cnt S_len = int(input().rstrip()) int(input().rstrip()) S_len S = input().rstrip().split(" ") input().rstrip().split(" ") S cnt = 0 0 cnt T_len = int(input().rstrip()) int(input().rstrip()) T_len cnt += t in S t in S cnt T = input().rstrip().split(" ") input().rstrip().split(" ") T
S_len = int(input().rstrip())
S = input().rstrip().split(" ")
T_len = int(input().rstrip())
T = input().rstrip().split(" ")

cnt = 0
for t in T:
    cnt += t in S
print(cnt)

