loop do
  n = gets.to_i
  break if n == 0
  taro = []
  n.times { taro << gets.to_i }
  taro.sort!
  hanako = (1..2*n).to_a - taro

  stage = 0
  loop do
    put_taro = false
    taro.each_with_index do |c, i|
      if c > stage
        stage = c
        taro.delete(c)
        put_taro = true
        break
      end
    end
    unless put_taro
      stage = 0
    end

    break if taro.empty? || hanako.empty?

    put_hanako = false
    hanako.each_with_index do |c, i|
      if c > stage
        stage = c
        hanako.delete(c)
        put_hanako = true
        break
      end
    end
    unless put_hanako
      stage = 0
    end

    break if taro.empty? || hanako.empty?
  end

  puts hanako.size, taro.size
end