object Main {
  def main (input: Array[String]): Unit = {
    val input = io.Source.stdin.getLines().mkString("\n")
    println (solve(input).trim())
  }

  def solve (input: String): String = {
    input.split("").filter(_=="1").size.toString()
  }
}
