import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    while (sc.hasNext()) {
        val a = Array(4, { sc.nextInt() })
        val b = Array(4, { sc.nextInt() })
        var (hit, blow) = Pair(0, 0)
        for ((i, n) in a.withIndex()) {
            if (b[i] == n) hit++
            else if (b.contains(n)) blow++
        }
        println("$hit $blow")
    }
}
