fun main(args: Array) { val a = mutableListOf(readLine()!!.toInt()) for(i in (2..99)) { a.add(a.last().toString().map { it.toString().toInt() }.sum()) } println(a.last()) }