fun main(args: Array<String>) {
    val player = readLine()?.orEmpty()
    val firstLine = readLine()?.split(" ").orEmpty()
    val colorList = listOf("gray","brown","green","marine","blue","yellow","orange","red")
    var rateList = mutableListOf<String>()
    var master = 0
    var min = 0
    var max = 0

    firstLine.forEach{
        val color = it.toInt() / 400
        if(color < 8){
            rateList.add(colorList[color])
        }else{
            master += 1
        }
    }
    min = rateList.distinct().size
    max = if(master + min < 8 ){
        min + master
    }else{
        8
    }

    println("$min $max")
}