The milliard Vasya's function 
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB 
Total submit users: 52, Accepted users: 36 
Problem 10005 :
No special judgement

Problem description 
Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But how can he do that if the most interesting facts such as Pythagor's theorem are already proved? Correct! He is to think out something his own, original. So he thought out the Theory of Vasya's Functions. Vasya's Functions (VF) are rather simple: the value of the N^{th} VF in the point S is the number of integers from 1 to N that have the sum of digits S. You seem to be great programmers, so Vasya gave you a task to find the milliard VF value (i.e. the VF with N=1000000000) because Vasya himself won't cope with the task. Can you solve the problem?

Input 
There will be multiple test cases. Each line of input contains one integer S (1 ¡Ü S ¡Ü 81). And the last line of 0 means the end of input which should not be processed.

Output 
For each test case, output the milliard VF value in the point S in a line.

Sample Input 
1
81
0 
Sample Output 
10
1 
Problem Source 
HNU Contest

Submit
Discuss
Judge Status
Problems
Ranklist
