import Data.Char (toLower)

initCharSet :: [(Char, Int)]
initCharSet = [(x, 0) | x <- ['a'..'z']]

incCharCount :: [(Char, Int)] -> Char -> [(Char, Int)]
incCharCount [] ch = []
incCharCount (x@(ch', n):xs) ch
  | toLower ch == ch' = (ch', n+1):xs
  | otherwise         = x:(incCharCount xs ch)

countChars :: String -> [(Char, Int)]
countChars = foldl incCharCount initCharSet

main :: IO ()
main = getContents >>= mapM_ (\(ch, n) -> putStrLn $ ch:" : " ++ show n) . countChars
