object Main {
  def main(args: Array[String]): Unit = {
    val lines = io.Source.stdin.getLines().toList
    println(solve(lines))
  }

  def solve(lines: List[String]): Int = {
    val list = lines(0).split("").map(_.toInt).toList
    list.filter(_ == 1).length
  }
}
