Lexicographical Maximum
题号:NC239331
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Eibwen is a newbie in Python.

You might know that when you input a number in the command line, your Python program will receive a string containing that number instead of a number that can be used to calculate. This is an interesting feature that a newbie might not know.

Eibwen wants to find the maximum of some given numbers, so he writes a program to sort the list of the numbers and print the last element in the sorted list. However, as a newbie, Eibwen doesn't know the feature. He actually sorts the list of number strings in lexicographical order and prints the last string in the list.

Now Eibwen runs his program, inputs all the integers from 1 to n, and finds his program really slow. Could you help him find out the expected output of his program?

输入描述:

The only line contains an integer n () — the size of Eibwen's input.

输出描述:

Print the expected output of Eibwen's program in a single line, which actually is the lexicographically maximum from 1 to n.
示例1

输入

复制
616

输出

复制
99