main = do
  s <- getContents
  let t = get2 . lines $ s
  let v = map ( map (map (read::String->Int) . words) ) t
  mapM_ (putStrLn . unwords . map show . solve)  v
  where
    get2 :: [String] -> [[String]]
    get2 [] = []
    get2 xs = (take 2 xs) : get2(drop 2 xs)

solve::[[Int]] -> [Int]
solve [s,t] = [hit,blow]
  where
    hit = length . filter id $ zipWith (\x y->x == y) s t
    blow = (flip (-) hit) . length . filter id $ [elem c t|c <- s]