import Control.Monad (replicateM)
import Data.List (sort)

main = do
    n <- readLn
    if n == 0 then return () else do
        as <- replicateM n readLn
        let
            (a,b) = game as (filter (not . (`elem` as)) [1..2*n])
        print a
        print b
        main

game :: [Int] -> [Int] -> (Int,Int)
game as bs = game' 'A' 0 (sort as) (sort bs) [] []
    where
    game' 'A' _ as [] as' [] = (0, (length as) + (length as'))
    game' 'B' _ [] bs [] bs' = ((length bs) + (length bs'), 0)
    game' 'A' _ [] bs as' bs' = game' 'B' 0 (reset [] as') (reset bs bs') [] []
    game' 'B' _ as [] as' bs' = game' 'A' 0 (reset as as') (reset [] bs') [] []
    game' 'A' l (a:as) bs as' bs'
        | a > l = game' 'B' a as bs as' bs'
        | otherwise = game' 'A' l as bs (a:as') bs'
    game' 'B' l as (b:bs) as' bs'
        | b > l = game' 'A' b as bs as' bs'
        | otherwise = game' 'B' l as bs as' (b:bs')

    reset xs xs' = (reverse xs') ++ xs