object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in);
    val num = sc.nextInt;
    println(calc(num.toString.split("").toList));
  }

  def calc(list:List[String]) : String = {
    list.count(_ == "1").toString
  }
}