len_s = int(input())
s = [int(i) for i in input().split()]
len_t = int(input())
t = [int(i) for i in input().split()]
cnt = 0

for f in t:
    i = 0
    while i < len(s) and s[i] != f:
        i += 1
    if i < len(s):
        cnt +=1
print(cnt) len_s = int(input()) len_s int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i s = [int(i) for i in input().split()] s [int(i) for i in input().split()] len_t = int(input()) len_t int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i t = [int(i) for i in input().split()] t [int(i) for i in input().split()] cnt = 0 cnt 0 for f in t:
    i = 0
    while i < len(s) and s[i] != f:
        i += 1
    if i < len(s):
        cnt +=1 f t i = 0 i 0 while i < len(s) and s[i] != f:
        i += 1
     i < len(s) and s[i] != f i < len(s) i len(s) len s s[i] != f s[i] s i f i += 1 i 1 if i < len(s):
        cnt +=1 i < len(s) i len(s) len s cnt +=1 cnt 1 print(cnt) print cnt len_s = int(input()) int(input()) len_s cnt = 0 0 cnt s = [int(i) for i in input().split()] [int(i) for i in input().split()] s cnt +=1 1 cnt t = [int(i) for i in input().split()] [int(i) for i in input().split()] t len_t = int(input()) int(input()) len_t i = 0 0 i i += 1 1 i
len_s = int(input())
s = [int(i) for i in input().split()]
len_t = int(input())
t = [int(i) for i in input().split()]
cnt = 0

for f in t:
    i = 0
    while i < len(s) and s[i] != f:
        i += 1
    if i < len(s):
        cnt +=1
print(cnt)