main = do
--  ns <- fmap (fmap (read :: String -> Int) . words) . lines <$> getContents
--  n <- fmap (read :: String -> Int) . words <$> getLine
  n <- getLine
  let c = length $ filter (\x ->  x == '1') n
  putStrLn $ show c