open Printf
open Scanf
       
module IntSet = Set.Make(struct
                          type t = int
                          let compare x y = x - y
                        end)

let _ = 
  try
    while true do
      let a = scanf "%d %d %d %d\n" (fun w x y z -> [w; x; y; z]) in
      let b = scanf "%d %d %d %d\n" (fun w x y z -> [w; x; y; z]) in
      let sa = IntSet.of_list a
      and sb = IntSet.of_list b in
      let hitn = List.fold_left (+) 0 (List.map2 (fun x y -> if x = y then 1 else 0) a b) in
      let blown = IntSet.cardinal (IntSet.inter sa sb) - hitn in
      printf "%d %d\n" hitn blown
    done
  with
    End_of_file -> ()