import Data.List
import Data.Char
main = getContents >>= putStrLn.show.count.map (map (replace.toUpper)).takeWhile (/="END_OF_TEXT").lines
    where count (x:xs) = length.filter (==x) $words (concat xs)
          replace c | c `elem` ['A'..'Z'] = c
                    | otherwise           = ' '