import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  def nextInt() = sc.next.toInt

  val n = nextInt
  val s = List.fill(n)(nextInt)

  val q = nextInt
  val t = Seq.fill(q)(nextInt)

  val c = (0 /: t) { (c, e) =>
    def find(xs: List[Int]): Boolean = xs match {
      case x :: xs =>
        if (x == e) true
        else find(xs)
      case Nil => false
    }
    if (find(s)) c + 1
    else c
  }
  println(c)
}

