1597 对称数个数


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

对称数很和谐。小强便想看看,在某个确定的整数内,到底有多少个对称数。例如,20之内,1,2,3,4,5,6,7,8,9,11都是对称的,所以20之内有10个对称数。小强随即展开了研究……

Input

若干个整数N(0<N<10^7)。当N为0时,输入结束。

Output

对于每个数N,输出N之内对称数的个数。

Sample

Input

100
20

Output

18
10

Source: qianneng


Comments

There are no comments at the moment.