module Main where

import Data.Char
import Data.Maybe
import Data.List

main :: IO ()
main = putStr
     . unlines
     . map ppr
     . countUps
     . map runlength
     . group
     . sort
     . map toLower
     . filter isAlpha
     =<< getContents

ppr :: (Char, Int) -> String
ppr (c,n) = c : (" : " ++ show n)

countUps :: [(Char, Int)] -> [(Char, Int)]
countUps rs = map (count rs) ['a' .. 'z']

count :: [(Char, Int)] -> Char -> (Char, Int)
count rs c = maybe (c,0) ((,) c) (lookup c rs)

runlength :: [Char] -> (Char, Int)
runlength cs = (head cs, length cs)