#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
m=int(raw_input())
n=map(int, raw_input().split())
o=int(raw_input())
p=map(int, raw_input().split())
for j in xrange(o):
    if int(p[j]) in n: i+=1
print i import time time import sys sys import io io import re re import math math start = time.clock() start time.clock() time.clock time clock i = 0 i 0 m=int(raw_input()) m int(raw_input()) int raw_input() raw_input n=map(int, raw_input().split()) n map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split o=int(raw_input()) o int(raw_input()) int raw_input() raw_input p=map(int, raw_input().split()) p map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split for j in xrange(o):
    if int(p[j]) in n: i+=1 j xrange(o) xrange o if int(p[j]) in n:  int(p[j]) in n int(p[j]) int p[j] p j n print start = time.clock() time.clock() start m=int(raw_input()) int(raw_input()) m o=int(raw_input()) int(raw_input()) o i = 0 0 i p=map(int, raw_input().split()) map(int, raw_input().split()) p n=map(int, raw_input().split()) map(int, raw_input().split()) n
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
m=int(raw_input())
n=map(int, raw_input().split())
o=int(raw_input())
p=map(int, raw_input().split())
for j in xrange(o):
    if int(p[j]) in n: i+=1
print i