fun ans (a: Array<Int>): String {
  val count = a.count{it >= 1}
  if (a[8] == 0) {
    return "${count} ${count}"
  } else {
    val diff = a.count{it == 0} - a[8]
    if (diff < 0) {
      return "${count-1} ${8}"
    } else {
      return "${count-1} ${count-1+a[8]}"
    }
  }
}

fun main (args: Array<String>) {
  val N = readLine()!!.toInt()
  var a = readLine()!!.split(" ")
  var lis = Array(9, {0})
  var idx = 0
  for (i in 0..2800 step 400){
    lis[idx] = a.filter{i <= it.toInt()}.filter{it.toInt() < i + 400}.size
    idx++
  }
  lis[8] = a.filter{3200 <= it.toInt()}.size
  println(ans(lis))
}
