Problem A
Baloni
There are
Our hero’s goal is to pop all the balloons using as few arrows as possible.
Input
The first line of input contains the integer
Output
The first and only line of output must contain the minimal number of times Pero needs to shoot an arrow so that all balloons are popped.
Sample Input 1 | Sample Output 1 |
---|---|
5 2 1 5 4 3 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
5 1 2 3 4 5 |
5 |
Sample Input 3 | Sample Output 3 |
---|---|
5 4 5 2 1 4 |
3 |