import Control.Applicative
import Data.List

wordsWhen     :: (Char -> Bool) -> String -> [String]
wordsWhen p s =  case dropWhile p s of
                      "" -> []
                      s' -> w : wordsWhen p s''
                            where (w, s'') = break p s'

main :: IO ()
main = do
    a <- $ wordsWhen (==' ') getLine
    putStrLn $ show ($ length $ nub a)