1801.Lucky Year

Time Limit: 1s Memory Limit: 256MB

Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not.

You are given current year in Berland. Your task is to find how long will residents of Berland wait till the next lucky year.

Input Format(From the terminal/stdin)

The first line contains integer number n (1 \le n \le 109) - current year in Berland.

Output Format(To the terminal/stdout)

Output amount of years from the current year to the next lucky one.

Sample Input 1

Copy
4
 \n

Sample Output 1

Copy
1
 \n

Sample Input 2

Copy
201
   \n

Sample Output 2

Copy
99
  \n

Sample Input 3

Copy
4000
    \n

Sample Output 3

Copy
1000
    \n

Hints

In the first example next lucky year is 5. In the second one - 300. In the third - 5000.

Submit

请先 登录

© 2025 FAQs