object Main {
  def main(args: Array[String]) = {
    val s = scala.collection.mutable.Queue[String]()

    for (x <- io.Source.stdin.getLines()) {
      s += x
      if (s.size == 2) {
        val a = s.dequeue().split(' ').map(n => n.toInt)
        val b = s.dequeue().split(' ').map(n => n.toInt)
        val (hit, blow) = hitAndBlow(a, b)
        println(hit + " " + blow)

      }
    }
  }

  def hitAndBlow(a: Seq[Int], b: Seq[Int]): Tuple2[Int, Int] = {
    var hit = 0
    for (i <- 0 until 4) {
      if (a(i) == b(i)) {
        hit += 1
      }
    }

    val blow = a.intersect(b).size - hit

    (hit, blow)
  }
}