import scala.io.StdIn._
import scala.annotation.tailrec

object Main {

  //f(x) => (-1,0,1)
  @tailrec
  def binarySearch(f: Int => Int,l: Int, r: Int): Int = {
    if(r-l<=1)f(l)
    else if(f((l+r)/2) < 1)binarySearch(f,(l+r)/2,r)
    else binarySearch(f,l,(l+r)/2)
  }

  def main(args: Array[String]): Unit = {
    val n = readInt
    val list = readLine.split(" ").map(_.toInt).toList

    val f = (ar: List[Int]) => (a: Int) => (x: Int) => ar(x)-a

    val q = readInt
    val qlist = readLine.split(" ").map(_.toInt)

    val res = for(e <- qlist)yield(0 == binarySearch(f(list)(e),0,n))
    println(res.toList.map(if(_) 1 else 0).sum)
  }
}