#C1682. Count Sunlit Buildings

    ID: 44914 Type: Default 1000ms 256MiB

Count Sunlit Buildings

Count Sunlit Buildings

You are given a sequence of building heights. A building is considered to be sunlit if it is taller than every building to its left. In other words, for a building at index i with height \(H_i\), it is sunlit if:

[ H_i > \max{ H_1, H_2, \ldots, H_{i-1} } ]

Your task is to count the number of sunlit buildings.

Example:

Input:
6
7 4 8 2 9 3

Output: 3

</p>

inputFormat

The first line of input contains an integer n representing the number of buildings. The second line contains n space-separated integers representing the heights of the buildings.

outputFormat

Output a single integer, the number of sunlit buildings.

## sample
6
7 4 8 2 9 3
3