# -*- coding: utf-8 -*-

n = int(input())
s = list(input().split())
n = int(input())
t = list(input().split())
cnt = 0
for i in range(n):
    if t[i] in s:
        cnt += 1

print(cnt) n = int(input()) n int(input()) int input() input s = list(input().split()) s list(input().split()) list input().split() ().split () input split n = int(input()) n int(input()) int input() input t = list(input().split()) t list(input().split()) list input().split() ().split () input split cnt = 0 cnt 0 for i in range(n):
    if t[i] in s:
        cnt += 1 i range(n) range n if t[i] in s:
        cnt += 1 t[i] in s t[i] t i s cnt += 1 cnt 1 print(cnt) print cnt n = int(input()) int(input()) n s = list(input().split()) list(input().split()) s t = list(input().split()) list(input().split()) t n = int(input()) int(input()) n cnt += 1 1 cnt cnt = 0 0 cnt
# -*- coding: utf-8 -*-

n = int(input())
s = list(input().split())
n = int(input())
t = list(input().split())
cnt = 0
for i in range(n):
    if t[i] in s:
        cnt += 1

print(cnt)
