import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)
 
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

countOne :: String -> Char -> Int
countOne [] _ = 0
countOne (x:xs) c | x == c = 1 + countOne xs c
                  | otherwise = countOne xs c

main = do
  number <- readInts
  let xs = show $ head number
  putStrLn $ show $ countOne xs '1'