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

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