#B4055. Good Phoenix Babies

    ID: 11712 Type: Default 1000ms 256MiB

Good Phoenix Babies

Good Phoenix Babies

Phoenix Mom has \(n\) phoenix babies with ages \(1,2,\dots,n\). Each baby with age \(i\) has an aspiration value \(a_i\) (a positive integer). A baby is considered a good baby if its aspiration value is greater than all babies with higher age. Note that the phoenix baby with age \(n\) is always a good baby.

Given the aspiration values of all the \(n\) babies, count the number of good babies.

inputFormat

The first line contains a positive integer \(n\) representing the number of phoenix babies. The second line contains \(n\) space-separated positive integers \(a_1, a_2, \dots, a_n\), where \(a_i\) denotes the aspiration value of the baby with age \(i\).

outputFormat

Output a single integer that represents the number of good babies.

sample

3
1 2 3
1