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

func main() {
    let line = readLine()!
    let count = line.reduce(0) { $0 + Int(String($1))! }
    
    print("\(count)")
}

main()
