Scoreboard
In a medieval city, it was decided to install a special display board in the central square to show the current year. Since computers did not exist in the Middle Ages, this display was crafted from stone.
The display features four digits, allowing it to show any year up to 9999. To ensure the townspeople could easily see the current year, the digits were made large and heavy.
This display was not electronic; the numbers had to be changed manually using rather primitive mechanical devices. These devices consisted of various blocks and levers, mysteriously interconnected. Each device was designed to replace exactly one digit, and it was so fragile that it broke immediately after use.
As the chief sage and astrologer of the city, your task is to calculate how many such devices will be needed to ensure the display functions properly, assuming it will be used from the year n to the year 9999.
Input
The input file contains an integer n (1000 ≤ n ≤ 9999).
Output
Output the answer to the problem in the output file.