#T199. 拦截导弹

拦截导弹

Description

A certain country has developed a missile interception system to defend against missile attacks from enemy nations. However, this system has a flaw: while its first projectile can reach any altitude, each subsequent projectile cannot exceed the height of the previous one.

One day, radar detected incoming enemy missiles. Since the system is still in the trial phase, only one set is available, so it may not be able to intercept all the missiles.

Given the heights of the incoming missiles in sequence (the radar provides height data as positive integers no greater than 30,000), calculate the maximum number of missiles this system can intercept.

Input Format

The first line is an integer N (no more than 15), representing the number of missiles.
The second line contains N integers, representing the heights of the incoming missiles in sequence (the radar provides height data as positive integers no greater than 30,000).

Output Format

An integer representing the maximum number of missiles that can be intercepted.

8
389 207 155 300 299 170 158 65

6