import scala.io.StdIn._
 
object Main extends App{
  val sc = new java.util.Scanner(System.in)
  val n = sc.next
  var count =0
  for(i <- 0 to 2){
    if(n(i)=='1'){
      count+=1
    }
  }
    println(count)
}