#t365. 拦截导弹问题

拦截导弹问题

Missile Interception (Minimum Systems)

Problem Description

A country has developed a missile interception system to defend against enemy missile attacks. However, this system has a flaw: while its first shell can reach any altitude, every subsequent shell cannot fly higher than the previous one.

One day, radar detected incoming enemy missiles. Since the system is still in the trial phase, a single system may not be able to intercept all the missiles.

The radar reports the incoming heights of the missiles in order (each height is a positive integer not greater than 3000030000). Compute the minimum number of such interception systems needed to intercept all missiles.

Input Format

A single line containing nn heights given in order (1≤n≤1000)(1\le n\le 1000).

Output Format

Output the minimum number of systems kk needed to intercept all missiles.

Sample Input

389 207 155 300 299 170 158 65

Sample Output

2

Constraints

Each missile height is a positive integer ≤30000\le 30000; 1≤n≤10001\le n\le 1000.

Time limit 1s, memory limit 1024KiB for each test case.

Hint

Example: missiles of heights 4 3 24\ 3\ 2 can all be intercepted by a single system, so k=1k=1.