import Control.Applicative import Control.Monad import System.IO import Data.List numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" hasChar :: String -> String -> Int hasChar x p = if (any (\a -> elem a p) x) then 1 else 0 missing :: String -> Int missing password = 4 - (hasChar password numbers) - (hasChar password lower_case) - (hasChar password upper_case) - (hasChar password special_characters) main :: IO () main = do n_temp <- getLine let n = read n_temp :: Int password <- getLine let m = missing password putStrLn $ show (max m (6 - (length password)))