print(readLine()!.flatMap {Int(String($0))}.reduce(0) {$0 + $1})