Under construction

Still being built. Things may change

Physics Experiment

Interview

Time limit1sMemory limit1024 MB

Summary
Round a given integer zero or more times to any place to maximize its value, and print the maximum reachable result.
Level

Medium4 of 10

Topics
Greedy, Math, Implementation, String
Solved
No attempts yet

Problem

Yunee is taking a physics lab class. One day, after finishing an experiment, Yunee noticed that some figures in the experiment result came out lower than expected. So Yunee decided to manipulate the result by rounding the values several times.

When rounding a number to the ii-th place, it is rounded down if the digit one place right of the ii-th place is less than 55. Otherwise, it is rounded up. For example, rounding 454454 to the nearest tens gives 450450. On the other hand, rounding 454454 to the nearest hundreds gives 500500.

By rounding 454454 to the nearest hundreds and then to the nearest thousands, we get 454→500→1000454 \rightarrow 500 \rightarrow 1000. This is the maximum value we can get by rounding 454454 zero or more times.

Help Yunee maximize the value in the experiment result by rounding it zero or more times.

Input

The first line contains an integer NN representing the value in the experiment result (1≤N≤1015)(1\le N \le 10^{15}). Note that NN may exceed the 32-bit integer limit.

Output

Output the maximized value obtained by rounding NN zero or more times. The output should not have leading zeros.

Examples3

  1. Example 1

    Input
    454
    
    Expected output
    1000
    
  2. Example 2

    Input
    4445
    
    Expected output
    10000
    
  3. Example 3

    Input
    1234321
    
    Expected output
    1234321