loop do
  n = gets.to_i
  break if n == 0
  # taro,hanakoにカードを配布（ソート）
  taro = []
  hanako = []
  cards = Array.new(n*2) {false}
  for i in 0...n do
    k = gets.to_i
    cards[k-1] = true
    taro[i] = k
  end
  for i in 1..(n*2) do
    hanako << i if cards[i-1] == false
  end
  taro.sort!

  # 場に出ているカード
  ba = 0
  turn = :taro
  while !taro.empty? && !hanako.empty?
    if turn == :taro
      if i = taro.index {|m| ba < m}
        # puts "taro #{taro[i]}"
        ba = taro[i]
        taro.delete_at(i)
      else
        ba = 0
      end
      turn = :hanako
    else
      if i = hanako.index {|m| ba < m}
        # puts "hanako #{hanako[i]}"
        ba = hanako[i]
        hanako.delete_at(i)
      else
        ba = 0
      end
      turn = :taro
    end
  end

  puts hanako.length
  puts taro.length
end