
object Main extends App {
  val scanner = new java.util.Scanner(System.in)
  scanner.useDelimiter("")

  val input = Iterator.continually(scanner.hasNext())
    .takeWhile(identity)
    .map(_ => scanner.next())
    .filter(s => ('A' to 'z').contains(s.head))

  val outputs = input.foldLeft(List.fill('z' - 'a' + 1)(0)) { (list, c) =>
    val lower = c.head.toLower
    val index = lower - 'a'

    list.updated(index, list(index) + 1)
  }.zipWithIndex

  outputs.foreach { t =>
    println(s"${('a' + t._2).toChar} : ${t._1}")
  }
}