Given columns of cubes, the -th has height . Find the smallest number of colors sufficient to color all the cubes so that all substrings and columns have different colors. Note that the substring — is a horizontal sequence of cubes in a row, that is, without gaps.
The first line contains one integer () — the number of columns.
The second line contains integers () — the height of the -th column.
Print one number — the minimum number of colors required to paint all cubes so that all substrings and columns have different colors.
One of the possible solutions:
Note that the third row from the bottom can have two identical colors if there is an empty space between them (the height of the third column is ).