fun main(args: Array<String>) {

    val num = readLine()!!.toInt()

    // 10の階乗の場合
    if (num % 10 == 0)
        println(10)
    else
        println(devideUnit(num))


    // LOOK 正の整数は1以上
}

fun devideUnit(n: Int): Int {

    var loopTarget = n
    var sum = 0

    while (loopTarget > 0) {
        sum += loopTarget % 10
        loopTarget /= 10
    }

    return sum
}