#agc029c. [agc029_c]Lexicographic constraints
[agc029_c]Lexicographic constraints
Problem Statement
There are strings arranged in a row. It is known that, for any two adjacent strings, the string to the left is lexicographically smaller than the string to the right. That is, holds lexicographically, where is the -th string from the left.
At least how many different characters are contained in , if the length of is known to be ?
Constraints
- is an integer.
Note
The strings do not necessarily consist of English alphabet; there can be arbitrarily many different characters (and the lexicographic order is defined for those characters).
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible number of different characters contained in the strings.
Sample Input 1
3
3 2 1
Sample Output 1
2
The number of different characters contained in would be when, for example, abc
, bb
and c
.
However, if we choose the strings properly, the number of different characters can be .
Sample Input 2
5
2 3 2 1 2
Sample Output 2
2