object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val rates = List.fill(sc.nextInt())(sc.nextInt() / 400)
  val groupedCounts = rates.groupBy(identity).view.mapValues(_.length)
  val colored = 0.to(7).count(groupedCounts.contains)
  val (min, max) = (colored.max(1), colored + groupedCounts.getOrElse(8, 0))
  println(s"$min $max")
}
