import Control.Applicative import Control.Monad import System.IO main :: IO () main = do n_temp <- getLine let n = read n_temp :: Int password <- getLine let sats = map (\chrs -> isSat chrs password) [numbers, lower_case, upper_case, special_characters] len = length (filter (not) sats) pLen = length password print $ if len + pLen >= 6 then len else 6 - pLen isSat :: [Char] -> String -> Bool isSat chrs = or . map (`elem` chrs) numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+"