#ABC124B. Great Ocean View

Great Ocean View

题目描述

There are NN mountains ranging from east to west, and an ocean to the west.

At the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.

The height of the ii-th mountain from the west is HiH_i.

You can certainly see the ocean from the inn at the top of the westmost mountain.

For the inn at the top of the ii-th mountain from the west (i=2,3,...,N)(i = 2, 3, ..., N), you can see the ocean if and only if H1HiH_1 \leq H_i, H2HiH_2 \leq H_i, ......, and Hi1HiH_{i-1} \leq H_i.

From how many of these NN inns can you see the ocean?

从东到西有 NN 座山,西面是大海。

每座山的山顶都有一家客栈。您决定从这些客栈中选择一家下榻。

从西面看 ii 这座山的高度是 HiH_i

从最西边山顶的客栈一定可以看到大海。

从西面 (i=2,3,...,N)(i = 2, 3, ..., N)ii 第三座山顶上的客栈,你可以看到大海,前提是 H1HiH_1 \leq H_iH2HiH_2 \leq H_i......Hi1HiH_{i-1} \leq H_i

你能从其中几个 NN 旅馆看到大海?

输入格式

输入内容按以下格式标准输入:

NN
H1H_1 H2H_2 ...... HNH_N

输出格式

打印可以看到大海的旅馆数量。

样例 #1

样例输入 #1

4
6 5 6 8

样例输出 #1

3

样例 #2

样例输入 #2

5
4 5 3 5 4

样例输出 #2

3

样例 #3

样例输入 #3

5
9 5 6 8 4

样例输出 #3

1

说明

数据规模与约定

  • 所有输入值均为整数。
  • 1N201 \leq N \leq 20
  • 1Hi1001 \leq H_i \leq 100

样例 11 解释

从西面的第一、第三和第四家旅馆可以看到大海。