fun main(args : Array ) { val a = readLine()!!.toLong() val b = 1000000001L val ans = (1..a/b).map { x -> val c1 = (x * b).toString().toList() val c2 = c1.reversed() c1.zip(c2).all { xy -> val (x,y) = xy x == y } }.count { x -> x == true } println( ans ) }