{-# LANGUAGE TypeApplications #-}
import Control.Monad
import Control.Applicative
import Data.Maybe
import qualified Data.List as List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Set as Set

getNList n = replicateM (fromIntegral n) BS.getLine

main :: IO ()
main = do
  n <- read @Int <$> getLine
  c <- getNList n
  print $ List.length $ ordNub c

ordNub :: Ord a => [a] -> [a]
ordNub xs = foldr (\x k s -> if Set.member x s
  then k s
  else x : k (Set.insert x s))
  (const []) xs Set.empty