package Yukicoder /** * Created by hichikawa on 2015/11/02. */ fun main(args: Array) { val str = readLine() as String var sum = 0 as Int for (ch : Char in str) { when (ch) { '1','2','3','4','5','6','7','8','9' -> sum += ch.toString().toInt() } } println(sum) }