#!/usr/bin/python
# -*- coding:utf-8 -*-

n = int(input())
S = list(map(int, input().split(" ")))
q = int(input())
T = list(map(int, input().split(" ")))

num = 0
for t in T:
    if t in S:
        num += 1
print(num) n = int(input()) n int(input()) int input() input S = list(map(int, input().split(" "))) S list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " q = int(input()) q int(input()) int input() input T = list(map(int, input().split(" "))) T list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " num = 0 num 0 for t in T:
    if t in S:
        num += 1 t T if t in S:
        num += 1 t in S t S num += 1 num 1 print(num) print num n = int(input()) int(input()) n num += 1 1 num q = int(input()) int(input()) q num = 0 0 num T = list(map(int, input().split(" "))) list(map(int, input().split(" "))) T S = list(map(int, input().split(" "))) list(map(int, input().split(" "))) S
#!/usr/bin/python
# -*- coding:utf-8 -*-

n = int(input())
S = list(map(int, input().split(" ")))
q = int(input())
T = list(map(int, input().split(" ")))

num = 0
for t in T:
    if t in S:
        num += 1
print(num)