import java.io.InputStream
import java.io.PrintStream
import java.util.*

class Abc081A(
    val input: InputStream,
    val output: PrintStream
) {
    fun proc() {
        val sc = Scanner(input)
        val a = sc.nextLine()
        val res = a.toCharArray().count { it == '1' }
        output.print(res)
    }
}

fun main(args: Array<String>) {
    Abc081A(System.`in`, System.out).proc()
}
