func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let line = readLine()!
    let ints = line.map { (char) -> Int in
        let s = String(char)
        return Int(s)!
    }
    let count = ints.filter {$0 == 1}.count

    print("\(count)")
}

main()
