#K85572. Tallest Structure
Tallest Structure
Tallest Structure
You are given an array of integers representing the heights of blocks. Your task is to build a structure by stacking some of these blocks such that each block placed on top is strictly less in height than the block below it. In other words, if the blocks in the structure (from bottom to top) have heights \(a_1, a_2, \ldots, a_k\), then they must satisfy the condition:
[ a_1 > a_2 > \cdots > a_k ]
Your goal is to determine the maximum possible height \(k\) of a structure that can be built under these rules. You can rearrange the blocks in any order you wish.
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains a single integer \(N\) (\(1 \le N \le 10^5\)) representing the number of blocks.
- The second line contains \(N\) space-separated integers \(h_1, h_2, \ldots, h_N\) representing the heights of the blocks.
outputFormat
Output a single integer on standard output (stdout) which is the maximum height of the structure that can be built.
## sample5
1 2 3 4 5
5