import Foundation

let input_line: String = readLine()!
//let split: [String] = input_line.components(separatedBy: "")
//let a = Int(split[0])!
//let b = Int(split[1])!
//let c = Int(split[2])!
let num = Int(input_line)!

var result = 0


for num in input_line {
    if num == '1' {
        result += 1
    }
}
 print(result)