#C10509. Counting People Who Can See the Front
Counting People Who Can See the Front
Counting People Who Can See the Front
You are given a queue of people represented by their heights. A person can see the front if and only if they are strictly taller than everyone in front of them.
Formally, if the heights of the people are given in order as \(h_1, h_2, \dots, h_n\), then person \(i\) can see the front if \(h_i > \max\{h_1, h_2, \dots, h_{i-1}\}\). Note that the first person in the queue always sees the front.
Your task is to determine the number of people who can see the front.
inputFormat
The first line contains an integer \(N\) denoting the number of people in the queue. The second line contains \(N\) space-separated integers representing the heights of the people in order.
outputFormat
Print a single integer representing the number of people who can see the front of the queue.
## sample5
140 150 130 160 140
3