Problem:
Score : 200 points

Problem Statement

There are N 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 i-th mountain from the west is H_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 i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \leq H_i, H_2 \leq H_i, ..., and H_{i-1} \leq H_i.

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

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq H_i \leq 100

Input

Input is given from Standard Input in the following format:

N
H_1 H_2 ... H_N

Output

Print the number of inns from which you can see the ocean.

Sample Input 1

4
6 5 6 8

Sample Output 1

3

You can see the ocean from the first, third and fourth inns from the west.

Sample Input 2

5
4 5 3 5 4

Sample Output 2

3

Sample Input 3

5
9 5 6 8 4

Sample Output 3

1

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = ReadLineInt();
            var h = ReadLineIntSpilit();

            var re = 0;

            for (int i = 0; i < n; i++) {
                var f = true;
                for (int j = 0; j < i; j++) {
                    //前の山で海が見えない時
                    if (h[i] < h[j]) f = false;
                }
                if (f) re++;
            }

            Console.WriteLine(re);
            ReadLine();
        }

        //メモ

        //アルゴリズム

        //・全探索解

        /*
         * 例 [A, B, C]
         *
         *  A - B, A - C
         *  B - C
         * 
            for (int i = 0; i < n; i++) {
           
                for (int j = i + 1; j < n; j++) {

                    array[i], array[j]

                }
            }
        */

        // ・配列の前後を見る

        /*
         *  例 array[1, 2, 3, 4, 5]
         *  
         *  r = 3;
         * 
         *  array[i - 1] => 1
         *  array[i] => 2
         *  array[i + 1] => 3
         * 
         * //範囲
         * int r = 3;
         * 
         * for(int i = 1; i <= array.Length - r; i++) { }
         * 
         */

        //配列
        
            //降順
            //var sort = array.OrderBy(x => -x).ToArray();

            //合計値
            //array.Sum();

            //最大値
            //List.Sort(); List[Count() - 1] 

        //切り捨て

            //double d = Math.Floor(n);

        //切り上げ
       
            //double d = Math.Celling(n);

        //kのn乗
        //(int) Math.Pow(k, n);

        //for文の逆
        //for(int i = array.Length - 1; i >= 0; i--) { }


        /// <summary>
        /// 最大公約数
        /// </summary>
        static int gcd(int a, int b)
        {
            if (a > b) {
                return gcd(b, a);
            }

            while (b != 0) {
                var remainder = a % b;
                a = b;
                b = remainder;
            }

            return a;
        }

        //最小公倍数
        static int lcm(int a, int b) => a * b / gcd(a, b);

        /// <summary>
        /// コンビネーション
        /// </summary>
        static int nCm(int n, int m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * nCm(n - 1, m - 1) / m;
        }

        /// <summary>
        /// 数字配列の重複をカウント
        /// </summary>
        public static int DistinctInt(IEnumerable<int> array)
        {
            var q = array.Distinct().Count();
            return array.Count() - q;
        }

        /// <summary>
        /// 文字配列の重複をカウント
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static int DistinctString(IEnumerable<string> array)
        {
            var q = array.Distinct().Count();
            return array.Count() - q;
        }

        public static string ReadLine() => Console.ReadLine();
        public static int ReadLineInt() => int.Parse(Console.ReadLine());
        public static long ReadLineLongInt() => long.Parse(Console.ReadLine());
        public static string[] ReadLineStringSplit(char a = ' ') => ReadLine().Split(a).ToArray();
        public static int[] ReadLineIntSpilit(char a = ' ') => ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        public static long[] ReadLineLongSpilit(char a = ' ') => ReadLine().Split(a).Select(x => long.Parse(x)).ToArray();
        static string[] GetAlphaLowerArray() => new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
        static string[] GetAlphaUpperArray() => new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
    }
}