import System.IO (isEOF)

main = do
    quit <- isEOF
    if quit then return () else do
        input >>= return . solve >>= output
        main

input :: IO ([Int],[Int])
input = do
    as <- (map read . words) `fmap` getLine
    bs <- (map read . words) `fmap` getLine
    return (as,bs)

output :: (Int,Int) -> IO ()
output (h,b) = putStrLn $ unwords $ [show h, show b]

solve :: ([Int],[Int]) -> (Int,Int)
solve (as,bs) = (hit, blow)
    where
    hit  = length $ filter id $ [as!!i == bs!!j |i<-[0..3], j<-[0..3], i==j]
    blow = length $ filter id $ [as!!i == bs!!j |i<-[0..3], j<-[0..3], i/=j]