import scala.io.StdIn._

object Main {
  def main(args: Array[String]): Unit = {
    val s: List[String] = readLine().split("").toList
    println(solve(s))
  }

  def solve(strings: List[String]): Int = strings.foldLeft(0)((acc: Int, x: String) => if(x == "1") acc + 1 else acc)
}
