AtCoder Beginner Contest 124 - Great Ocean View

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-----
4
6 5 6 8

-----Sample Output-----
3

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

Source: atcoder | Difficulty: EASY


Solutions:
n = int(input())
h = list(map(int, input().split()))
kei = 1
m = h[0]
for i in range(1, n):
	if m <= h[i]:
		m = h[i]
		kei += 1
print(kei)


n = int(input())
l = list(map(int, input().split()))
s = 1
for i in range(1, n):
	if l[i] == max(l[:i + 1]):
		s += 1
print(s)


n = int(input())
a = list(map(int, input().split()))
c = 1
for i in range(1, n):
	if max(a[:i]) <= a[i]:
		c += 1
print(c)


N = int(input())
H = list(map(int, input().split()))
h_list = [H[0]]
cnt = 1
for i in range(1, N):
	h_list.append(H[i])
	if max(h_list) == H[i]:
		cnt += 1
print(cnt)


n = int(input())
h = list(map(int, input().split()))
ans = 1
m = h[0]
for i in h[1:]:
	if m <= i:
		ans += 1
		m = i
print(ans)


n = int(input())
(*h,) = map(int, input().split())
ans = sum([1 if h[i] == max(h[:i + 1]) else 0 for i in range(n)])
print(ans)


input()
l = 0
s = 0
for i in map(int, input().split()):
	if i >= l:
		l = i
		s += 1
print(s)


n = int(input())
l = list(map(int, input().split()))
Max = 0
cnt = 0
for i in l:
	if i >= Max:
		cnt += 1
		Max = i
print(cnt)


N = int(input())
H = list(map(int, input().split()))
maximum = H[0]
cnt = 1
for i in range(1, N):
	if H[i] >= maximum:
		maximum = H[i]
		cnt += 1
print(cnt)


n = int(input())
h = list(map(int, input().split()))
print(sum([max(h[0:i + 1]) == h[i] for i in range(n)]))


n = int(input())
H = list(map(int, input().split()))
ans = 0
m = -1000
for i in range(n):
	if m <= H[i]:
		m = H[i]
		ans += 1
print(ans)


N = int(input())
a = 0
ans = 0
for i in list(map(int, input().split())):
	if a <= i:
		ans += 1
		a = i
print(ans)


n = input()
x = 0
mh = 0
for i in input().split():
	i = int(i)
	if i >= mh:
		x += 1
		mh = i
print(x)


n = int(input())
l = [int(_) for _ in input().split()]
ans = 1
for i in range(1, n):
	if max(l[:i]) <= l[i]:
		ans += 1
print(ans)


n = int(input())
h = list(map(int, input().split()))
max = h[0]
c = 0
for i in range(n):
	if h[i] >= max:
		c += 1
		max = h[i]
print(c)


N = int(input())
H = list(map(int, input().split()))
i = 0
m = 0
for h in H:
	if h >= m:
		i = i + 1
		m = h
print(i)


N = int(input())
H = list(map(int, input().split()))
result = 1
H_high = H[0]
for i in range(1, N):
	if H[i] >= H_high and H[i] >= H[i - 1]:
		result += 1
		H_high = H[i]
print(result)


N = int(input())
X = [int(i) for i in input().split()]
ans = 1
for i in range(1, N):
	if X[i] >= max(X[0:i]):
		ans += 1
print(ans)


n = int(input())
h = list(map(int, input().split()))
ans = 1
for i in range(1, len(h)):
	if h[i] >= max(h[:i]):
		ans += 1
print(ans)


n = int(input())
h = list(map(int, input().split()))
res = 1
h_max = h[0]
for i in range(1, len(h)):
	if h[i] >= h_max:
		res += 1
		h_max = h[i]
print(res)


N = int(input())
H = list(map(int, input().split()))
print(len([i for i in range(N) if H[i] >= max(H[:i + 1])]))


(n, *a) = map(int, open(0).read().split())
p = 0
c = 0
for i in range(n):
	if p <= a[i]:
		c += 1
		p = a[i]
print(c)


n = int(input())
a = map(int, input().split())
minn = 0
ans = 0
for i in a:
	if i >= minn:
		ans += 1
		minn = i
print(ans)


N = int(input())
H = list(map(int, input().split()))
a = 1
for i in range(1, N):
	if H[i] >= max(H[0:i]):
		a += 1
print(a)


n = int(input())
q = list(map(int, input().split()))
m = 0
cnt = 0
for i in range(n):
	if m <= q[i]:
		cnt += 1
	m = max(q[i], m)
print(cnt)


n = int(input())
H = map(int, input().split())
k = 0
j = 0
for num in H:
	if num >= k:
		j = j + 1
		k = num
print(j)


n = int(input())
H = list(map(int, input().split()))
high = H[0]
ct = 1
for i in range(1, n):
	if high <= H[i]:
		ct += 1
		high = H[i]
print(ct)


N = int(input())
H = list(map(int, input().split()))
Hmax = 0
R = 0
for Hi in H:
	if Hmax <= Hi:
		R += 1
		Hmax = Hi
print(R)


n = input()
(*h,) = map(int, input().split())
p = h[0]
c = 1
for e in h[1:]:
	if e >= p:
		c += 1
	p = max(p, e)
print(c)


n = int(input())
j = 0
p = 0
for i in map(int, input().split()):
	if j <= i:
		p += 1
		j = i
print(p)


n = int(input())
a = list(map(int, input().split()))
p = 1
for i in range(1, n):
	if a[i] >= max(a[0:i]):
		p += 1
print(p)


n = int(input())
a = list(map(int, input().split()))
(s, t) = (0, 0)
for i in a:
	if i >= s:
		s = i
		t += 1
print(t)


N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N):
	flag = True
	for j in range(i):
		if H[j] > H[i]:
			flag = False
			break
	if flag:
		ans += 1
print(ans)


n = int(input())
H = [int(i) for i in input().split()]
m = 0
ans = 0
for i in range(n):
	if H[i] >= m:
		m = H[i]
		ans += 1
print(ans)


(_, *l) = map(int, open(0).read().split())
m = c = 0
for i in l:
	if m <= i:
		m = i
		c += 1
print(c)


n = int(input())
h = map(int, input().split())
m = 0
ans = 0
for x in h:
	if x >= m:
		m = x
		ans += 1
print(ans)


N = int(input())
N_List = list(map(int, input().split()))
ans = 1
maxN = N_List[0]
for i in range(1, N):
	if N_List[i] >= maxN:
		ans += 1
		maxN = N_List[i]
print(ans)


N = int(input())
H = [int(i) for i in input().split()]
h = 0
ans = 0
for i in H:
	if h <= i:
		ans += 1
		h = i
print(ans)


x = int(input())
a = list(map(int, input().split()))
ans = 0
mdd = -10 ** 18
for i in a:
	if i >= mdd:
		mdd = i
		ans += 1
print(ans)


N = int(input())
H = list(map(int, input().split()))
cnt = 0
max_ = 0
for h in H:
	if h >= max_:
		cnt += 1
		max_ = h
print(cnt)


n = int(input())
h = list(map(int, input().split()))
ans = 1
for i in range(1, n):
	for j in range(0, i):
		if h[i] - h[j] < 0:
			break
	else:
		ans += 1
print(ans)


a = input()
H = map(int, input().split())
c = m = 0
for h in H:
	if m <= h:
		c += 1
		m = h
print(c)


(n, *h) = map(int, open(0).read().split())
print(sum((h[i] >= max(h[:i] or [0]) for i in range(n))))


input()
a = list(map(int, input().split(' ')))
M = 0
r = 0
for z in a:
	if M <= z:
		r += 1
		M = z
print(r)


n = int(input())
H = list(map(int, input().split()))
cnt = [0] * n
for i in reversed(list(range(1, n))):
	m = H[i]
	for j in range(0, i):
		if H[j] <= m:
			cnt[i] += 1
		else:
			break
ans = 0
for i in range(n):
	if cnt[i] == i:
		ans += 1
print(ans)


N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1, N):
	ans += max(H[0:i]) <= H[i]
print(ans)


n = int(input())
h = [int(x) for x in input().split()]
cnt = 1
for i in range(1, n):
	for j in range(i):
		if h[i] < h[j]:
			break
		if j == i - 1:
			cnt += 1
print(cnt)


N = int(input())
L = list(map(int, input().split()))
M = 0
for i in range(N):
	if L[i] >= max(L[0:i + 1]):
		M += 1
print(M)


n = int(input())
h = list(map(int, input().split()))
x = 1
ans = h[0]
for i in range(1, n):
	if h[i] >= ans:
		x = x + 1
		ans = h[i]
print(x)


n = int(input())
h = list(map(int, input().split()))
ans = 0
highest = 0
for height in h:
	highest = max(height, highest)
	if height >= highest:
		ans += 1
print(ans)


N = int(input())
H = list(map(int, input().split()))
ans = 0
mem = 0
for i in H:
	if mem <= i:
		ans += 1
	mem = max(mem, i)
print(ans)


n = int(input())
l = list(map(int, input().split()))
mx = l[0]
c = 1
for x in l[1:]:
	if x >= mx:
		c += 1
		mx = x
print(c)


input()
(*l,) = map(int, input().split())
print(1 + sum((max(l[0:i]) <= l[i] for i in range(1, len(l)))))


n = int(input())
h = list(map(int, input().split()))
a = h[0]
b = 0
for i in h:
	if i >= a:
		a = i
		b += 1
print(b)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def calc(i, h):
	return all((h[i] >= h[j] for j in range(i)))

def main():
	n = int(input())
	h = Input()
	ans = 1
	for i in range(1, n):
		ans += calc(i, h)
	print(ans)
main()


N = int(input())
H = [int(i) for i in input().split()]
c = 0
l = 0
for i in H:
	if i >= l:
		c += 1
		l = i
print(c)


from typing import List

def answer(n: int, h: List[int]) -> int:
	count = 0
	highest = 0
	for mountain in h:
		if highest <= mountain:
			highest = mountain
			count += 1
	return count

def main():
	n = int(input())
	h = list(map(int, input().split()))
	print(answer(n, h))

def __starting_point():
	main()
__starting_point()


n = int(input())
b = c = 0
for h in map(int, input().split()):
	if b <= h:
		b = h
		c += 1
print(c)


N = int(input())
H = list(map(int, input().split()))
highest = H[0]
ans = 0
for i in range(N):
	if highest <= H[i]:
		highest = H[i]
		ans += 1
print(ans)


n = int(input())
h = [int(s) for s in input().split()]
highest = h[0]
ans = 1
for i in range(1, n):
	if h[i] >= highest:
		ans += 1
		highest = h[i]
print(ans)


n = int(input())
a = list(map(int, input().split()))
cont = 1
h = a[0]
for i in range(1, n):
	if a[i] >= h:
		h = a[i]
		cont += 1
print(cont)


n = int(input())
mountains = list(map(int, input().split()))
total = 0
mountains_current = []
for i in range(n):
	mountains_current.append(mountains[i])
	if mountains[i] >= max(mountains_current):
		total += 1
print(total)


input()
lst = [int(i) for i in input().split()]
ans = 0
_max = lst[0]
for i in lst:
	if i >= _max:
		ans += 1
		_max = i
print(ans)


n = int(input())
h = list(map(int, input().split()))
i = 0
cnt = 0
for j in h:
	if i <= j:
		cnt += 1
		i = j
print(cnt)


n = int(input())
l = map(int, input().split())
m = c = 0
for i in l:
	if m <= i:
		m = i
		c += 1
print(c)


n = int(input())
h = list(map(int, input().split()))
count = 0
m = 0
for i in range(0, n):
	if i == 0:
		count += 1
		m = h[i]
	elif h[i] >= m:
		count += 1
		m = h[i]
print(count)


n = int(input())
h = list(map(int, input().split()))
m = 1
for i in range(1, n):
	if max(h[:i]) <= h[i]:
		m += 1
print(m)


N = int(input())
H = list(map(int, input().split()))
result = 1
H.reverse()
HH = H.copy()
for i in H:
	HH.remove(i)
	if len(HH) == 0:
		break
	for ii in HH:
		if i < ii:
			break
	else:
		result += 1
print(result)


N = int(input())
hm = 0
cnt = 0
for h in map(int, input().split()):
	if h >= hm:
		cnt += 1
		hm = h
print(cnt)


n = int(input())
hmax = 0
ans = 0
for h in map(int, input().split()):
	if hmax <= h:
		ans += 1
		hmax = h
print(ans)


N = int(input())
H = list(map(int, input().split()))
ans = 0
maxH = 0
for i in H:
	if maxH <= i:
		ans += 1
		maxH = i
print(ans)


(n, h) = open(0)
(*h,) = map(int, [0] + h.split())
print(sum((h[i] >= max(h[:i]) for i in range(1, int(n) + 1))))


N = int(input())
H = [int(i) for i in input().split()]
m = 0
b = 0
for a in H:
	if b <= a:
		m += 1
	b = max(b, a)
print(m)


(n, h) = (int(input()), list(map(int, input().split())))
print(sum((max(h[:x + 1]) == h[x] for x in range(n))))


n = int(input())
h = list(map(int, input().split()))
print([max(h[:i + 1]) == h[i] for i in range(n)].count(1))


n = int(input())
h = input().split()
ans = 0
hi = 0
for i in range(n):
	if int(h[i]) >= hi:
		ans += 1
		hi = int(h[i])
print(ans)


c = 0
m = 0
n = int(input())
a = input().split()
for i in range(n):
	if int(a[i]) >= m:
		c += 1
		m = int(a[i])
print(c)


N = int(input())
H = list(map(int, input().split()))
S = 0
m = 0
for h in H:
	if m <= h:
		S += 1
	m = max(m, h)
print(S)


N = int(input())
L = list(map(int, input().split()))
tmp = 0
ans = 0
for i in range(N):
	if tmp <= L[i]:
		tmp = L[i]
		ans += 1
print(ans)


num = int(input())
str = input().split()
table = [int(i) for i in str]
count = 1
maxi = table[0]
pointed = table[0]
for i in range(1, num):
	if maxi <= table[i]:
		maxi = table[i]
		count += 1
print(count)


N = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(1, N):
	if a[i] >= max(a[:i]):
		ans += 1
print(ans)


n = int(input())
h = list(map(int, input().split()))
cnt = 1
wk = h[0]
for i in range(n - 1):
	if wk <= h[i + 1]:
		cnt += 1
		wk = h[i + 1]
print(cnt)


n = int(input())
Hs = []
cnt = 0
for h in input().split():
	h = int(h)
	Hs.append(h)
	if max(Hs) == h:
		cnt += 1
print(cnt)


N = int(input())
l = list(map(int, input().split()))
th = 0
ans = 0
for x in l:
	if x >= th:
		ans += 1
		th = x
print(ans)


n = int(input())
hl = list(map(int, input().split()))
cnt = 0
hmax = 0
for h in hl:
	if hmax <= h:
		hmax = h
		cnt += 1
print(cnt)


input()
h = [int(s) for s in input().split()]
r = 0
for i in range(len(h)):
	if max(h[:i + 1]) == h[i]:
		r += 1
print(r)


N = int(input())
hotel = list(map(int, input().split()))
i = 0
j = 0
cnt = 0
for i in range(N):
	q = 1
	for j in range(i):
		q = 0
		if hotel[j] > hotel[i]:
			break
		else:
			q = 1
	if q == 1:
		cnt += 1
print(cnt)


n = int(input())
h = list(map(int, input().split()))

def answer(n: int, h: list) -> int:
	h_list = 0
	answer = 0
	for i in h:
		if h_list <= i:
			answer += 1
		h_list = max(h_list, i)
	return answer
print(answer(n, h))


def main():
	sea = 1
	n = int(input())
	h = list(map(int, input().split()))
	mountain = h[0]
	for i in range(1, n):
		if mountain <= h[i]:
			sea += 1
			mountain = h[i]
	print(sea)

def __starting_point():
	main()
__starting_point()


n = int(input())
list_h = [int(i) for i in input().split()]
count = 0
max = 0
for i in range(0, n):
	if list_h[i] >= max:
		count += 1
		max = list_h[i]
print(count)


n = int(input())
a = list(map(int, input().split()))
h_max = a[0]
r = 1
for ii in range(1, len(a)):
	if h_max <= a[ii]:
		r += 1
		h_max = a[ii]
print(r)


n = int(input())
h = list(map(int, input().split()))
ans = 0
for i in range(n):
	h_list = h[0:i + 1]
	highest = max(h_list)
	if highest <= h[i]:
		ans = ans + 1
print(ans)


N = int(input())
H = map(int, input().split())
ans = 0
num = 0
for i in H:
	if num <= i:
		ans += 1
		num = i
print(ans)


a = input()
b = c = 0
for i in map(int, input().split()):
	if b <= i:
		b = i
		c += 1
print(c)


N = int(input())
H = list(map(int, input().split()))
c = 1
h = H[0]
for i in range(1, N):
	if h <= H[i]:
		h = H[i]
		c = c + 1
print(c)


N = int(input())
H = list(map(int, input().split()))
ans = [1 for i in range(N)]
for i in range(1, N):
	for j in range(i):
		if H[j] > H[i]:
			ans[i] = 0
print(sum(ans))


n = int(input())
h = list(map(int, input().split()))
m = 0
ans = 0
for i in h:
	ans += i >= m
	m = max(m, i)
print(ans)


n = int(input())
h = [int(_) for _ in input().split(' ')]
print(len([i for i in range(n) if h[i] >= max(h[:i + 1])]))


n = int(input())
a = list(map(int, input().split()))
cnt = 0
ans = 0
for i in a:
	if cnt <= i:
		ans += 1
		cnt = i
print(ans)


N = int(input())
Hs = list(map(int, input().split()))
r = 1
n = Hs[0]
for h in Hs[1:]:
	if h >= n:
		r += 1
		n = h
print(r)


input()
lis = list(map(int, input().split()))
print(len([n for (i, n) in enumerate(lis[1:]) if n >= max(lis[:i + 1])]) + 1)


n = int(input())
li = list(map(int, input().split()))
mx = 0
ans = 0
for i in li:
	if mx <= i:
		mx = i
		ans += 1
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
result = 0
for (i, x) in enumerate(a):
	flg = True
	for c in a[:i]:
		flg = flg and c <= x
	if flg:
		result += 1
print(result)


(_, *hs) = map(int, open(0).read().split())
cou = 1
hm = hs[0]
for h in hs[1:]:
	if hm <= h:
		cou += 1
		hm = h
print(cou)


N = int(input())
H = map(int, input().split())
(ans, maxh) = (0, 0)
for h in H:
	if maxh <= h:
		ans += 1
		maxh = h
print(ans)


n = int(input())
H = list(map(int, input().split()))
count = 1
for i in range(1, n):
	if H[i] >= max(H[:i]):
		count += 1
print(count)


N = int(input())
H = list(map(int, input().split()))
print(sum((max(H[:i] + [0]) <= H[i] for i in range(N))))


N = int(input())
H = map(int, input().split())
height_list = list(H)
Inn = []
Ocean_view = []
i = 0
for j in range(N):
	Inn.append(height_list[i])
	if height_list[i] == max(Inn):
		Ocean_view.append(height_list[i])
	i += 1
print(len(Ocean_view))


N = int(input())
L = list(map(int, input().split()))
i = 0
j = 0
for n in range(N):
	if L[n] >= j:
		j = L[n]
		i = i + 1
print(i)


n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(n):
	check = True
	for j in range(i):
		if h[j] > h[i]:
			check = False
	if check:
		count += 1
print(count)


N = int(input())
H = list(map(int, input().split()))
ans = 0
maxm = 0
for h in H:
	if maxm <= h:
		ans += 1
		maxm = h
print(ans)


n = int(input())
a = list(map(int, input().split()))
b = 0
c = 0
for i in a:
	b = max(b, i)
	if i >= b:
		c += 1
print(c)


n = int(input())
data = list(map(int, input().split()))
ans = 1
for i in range(1, n):
	if all((data[i] >= j for j in data[0:i])):
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
print(sum((max([0] + a[:i]) <= a[i] for i in range(n))))


n = int(input())
hi = list(map(int, input().split()))
ans = [hi[0]]
hi0 = hi[0]
for i in hi[1:]:
	if hi0 <= i:
		ans.append(i)
		hi0 = max(hi0, i)
print(len(ans))


N = int(input())
H = list(map(int, input().split()))
max_height = 0
count = 0
for h in H:
	if h >= max_height:
		max_height = h
		count += 1
print(count)


N = int(input())
H = map(int, input().split())
m = 0
c = 0
for h in H:
	c += 1 if h >= m else 0
	m = max(m, h)
print(c)


n = int(input())
a = list(map(int, input().split()))
m = 0
c = 0
for x in a:
	if m <= x:
		c += 1
	m = max(m, x)
print(c)


n = int(input())
li = list(map(int, input().split()))
cnt = 0
min = li[0]
for i in li:
	if i >= min:
		cnt += 1
		min = i
print(cnt)


N = int(input())
Hlist = list(map(int, input().split()))
Vcnt = 0
for cnt in range(0, N, 1):
	maxH = max(Hlist[:cnt + 1])
	if Hlist[cnt] >= maxH:
		Vcnt += 1
print(Vcnt)


N = int(input())
H = list(map(int, input().split()))
h = 1
yama = []
yama.append(H[0])
while h <= N - 1:
	if max(H[:h]) <= H[h]:
		yama.append(H[h])
	h += 1
print(len(yama))


N = int(input())
H = list(map(int, input().split()))
answer = 0
height = H[0]
for i in H:
	if i >= height:
		answer += 1
	height = max(i, height)
print(answer)


N = int(input())
H = list(map(int, input().split()))
ans = 0
mx = H[0]
for h in H:
	if h >= mx:
		ans += 1
	mx = max(h, mx)
print(ans)


n = int(input())
(*H,) = map(int, input().split())
a = 0
for i in range(n):
	a += max(H[:i + 1]) == H[i]
print(a)


n = int(input())
l = list(map(int, input().split()))
c = 1
m = l.pop(0)
for e in l:
	if e >= m:
		c += 1
		m = e
print(c)


N = int(input())
h = list(map(int, input().split()))
m = 0
ct = 0
for i in range(N):
	if m <= h[i]:
		ct += 1
	m = max(m, h[i])
print(ct)


input()
ms = [int(i) for i in input().split()]
mh = 0
c = 0
for m in ms:
	if m >= mh:
		mh = m
		c += 1
print(c)


N = int(input())
H = list(map(int, input().split()))
x = 1
for i in range(N):
	for j in range(i):
		if H[i] < H[j]:
			break
		if j == i - 1:
			x += 1
print(x)


n = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(n):
	if max(H[:i + 1]) == H[i]:
		ans += 1
print(ans)


n = int(input())
h = [int(i) for i in input().split()]
print(sum((max(h[:i + 1]) <= h[i] for i in range(n))))


N = int(input())
H = list(map(int, input().split()))
cnt = 1
for j in range(1, N):
	if max(H[0:j + 1]) == H[j]:
		cnt += 1
print(cnt)


n = int(input())
h = list(map(int, input().split()))
x = 0
y = 0
z = 0
for x in range(n):
	if h[x] >= y:
		z += 1
		y = h[x]
print(z)


input().split()
h = list(map(int, input().split()))
r = 1
m = h[0]
for i in h[1:]:
	if i >= m:
		r += 1
		m = i
print(r)


mountain_number = input()
mountain_height = map(int, input().split())
observable_inn = observable_height = 0
for i in mountain_height:
	if i >= observable_height:
		observable_height = i
		observable_inn += 1
print(observable_inn)


n = int(input())
arr = list(map(int, input().split()))
m = 0
s = 0
for x in arr:
	if m <= x:
		m = x
		s += 1
print(s)


input()
r = list(map(int, input().split()))
c = 0
m = 0
for i in r:
	m = max(m, i)
	if m == i:
		c += 1
print(c)


(_, t) = open(0)
m = a = 0
for h in map(int, t.split()):
	a += h >= m
	m = max(m, h)
print(a)


(N, *H) = map(int, open(0).read().split())
print(sum((max(H[:i + 1]) == H[i] for i in range(N))))


N = int(input())
A = list(map(int, input().split()))
ans = 1
t = A[0]
for i in range(1, N):
	if t <= A[i]:
		ans += 1
		t = A[i]
print(ans)


n = int(input())
h = [int(x) for x in input().split()]
ans = 0
for i in range(n):
	if h[i] >= max(h[:i + 1]):
		ans += 1
print(ans)


A = int(input())
l = list(map(int, input().split()))
ans = 0
f = 0
for i in l:
	if f <= i:
		f = i
		ans += 1
print(ans)


n = int(input())
l = list(map(int, input().split()))
m = l[0]
ans = 0
for x in l:
	if m <= x:
		ans += 1
		m = x
print(ans)


N = int(input())
height = list(map(int, input().split()))
count = 1
max_height = height[0]
for i in range(1, N):
	if height[i] >= max_height:
		max_height = height[i]
		count += 1
print(count)


N = int(input())
h = list(map(int, input().split()))
ans = 0
for i in range(N):
	if max(h[:i + 1]) == h[i]:
		ans += 1
print(ans)


(n, *h) = map(int, open(0).read().split())
print(sum((max(h[:x + 1]) == h[x] for x in range(n))))


n = int(input())
ma = 0
ans = 0
for i in map(int, input().split()):
	if ma <= i:
		ans += 1
	ma = max(ma, i)
print(ans)


a = int(input())
b = list(map(int, input().split()))
c = 0
ans = 0
for i in range(a):
	if b[i] >= c:
		ans += 1
	c = max(c, b[i])
print(ans)


n = int(input())
l = list(map(int, input().split()))
total = 1
for i in range(1, n):
	if max(l[0:i]) <= l[i]:
		total += 1
print(total)


n = int(input())
H = list(map(int, input().split()))
h = 0
t = 0
for i in range(len(H)):
	if h <= H[i]:
		h = H[i]
		t += 1
print(t)


n = int(input())
l = map(int, input().split())
hst = 0
cnt = 0
for i in l:
	if hst <= i:
		hst = i
		cnt += 1
print(cnt)


N = int(input())
H = list(map(int, input().split()))
count = 1
for i in range(1, N):
	k = N - i
	temp = H[k]
	del H[-1]
	if temp >= max(H):
		count += 1
print(count)


n = int(input())
heights = list(map(int, input().split()))
cnt = 1
max = heights[0]
for p in range(n):
	if p == 0:
		continue
	elif max <= heights[p]:
		max = heights[p]
		cnt += 1
print(cnt)


n = int(input())
x = list(map(int, input().split()))
q = 0
p = 0
for i in range(n):
	for j in range(i):
		if i > j:
			if x[i] - x[j] >= 0:
				q += 1
			else:
				q = 0
				break
	if q > 0:
		p += 1
		q = 0
print(1 + p)


a = int(input())
b = list(map(int, input().split()))
c = 0
d = 0
for i in range(a):
	if c <= b[i]:
		c = b[i]
		d = d + 1
print(d)


n = input()
h_list = map(int, input().split())
a = 0
b = 0
for h in h_list:
	if b <= h:
		b = h
		a += 1
print(a)


N = int(input())
ls = list(map(int, input().split()))
m = 0
ii = 0
for i in range(N):
	if m <= ls[i]:
		ii += 1
		m = ls[i]
	else:
		continue
print(ii)


input()
(*H,) = map(int, input().split())
cnt = 0
a = 0
for h in H:
	if a <= h:
		cnt += 1
		a = h
print(cnt)


N = int(input())
H = list(map(int, input().split()))
a = 1
for n in range(1, N):
	if max(H[:1 + n]) == H[n]:
		a += 1
print(a)


N = int(input())
X = [int(i) for i in input().split()]
ans = 1
A = X.pop(0)
for i in X:
	if i >= A:
		ans += 1
		A = i
print(ans)


n = int(input())
h = [int(i) for i in input().split()]
count = 1
for i in range(1, n):
	if h[i] >= max(h[:i]):
		count += 1
print(count)


n = int(input())
H = [int(x) for x in input().split()]
m = -1
cc = 0
for h in H:
	cc += h >= m
	m = max(h, m)
print(cc)


input()
a = list(map(int, input().split()))
ret = 0
for (i, h) in enumerate(a):
	ret += max(a[:i + 1]) == h
print(ret)


N = int(input())
H = list(map(int, input().split()))
c = 0
for i in range(N):
	l = H[:i + 1]
	if max(l) == H[i]:
		c += 1
print(c)


n = input()
h = list(map(int, input().split()))
m = h[0]
c = 0
for i in h:
	if i >= m:
		c += 1
		m = i
	else:
		pass
print(c)


n = int(input())
hs = list(map(int, input().split()))
a = 1
x = hs[0]
for h in hs[1:]:
	if h >= x:
		a += 1
		x = h
print(a)


(n, *a) = map(int, open(0).read().split())
mx = cnt = 0
for i in a:
	if mx <= i:
		cnt += 1
		mx = i
print(cnt)


n = int(input())
a = map(int, input().split())
mx = 0
cnt = 0
for i in a:
	if i >= mx:
		cnt += 1
		mx = i
print(cnt)


N = int(input())
H = list(map(int, input().split()))
count = N
for i in range(N - 1):
	j = -1 - i
	if H[j] < max(H[:j]):
		count -= 1
print(count)


def main():
	N = int(input())
	h = list(map(int, input().split()))
	highest = 0
	res = 0
	for i in range(N):
		if h[i] >= highest:
			res += 1
			highest = h[i]
	print(res)
	return

def __starting_point():
	main()
__starting_point()


def view_check(n: int, heights: list) -> int:
	cnt = 1
	max_height = heights[0]
	for i in range(1, n):
		if heights[i] >= max_height:
			cnt += 1
			max_height = heights[i]
	return cnt

def __starting_point():
	n = int(input())
	heights = list(map(int, input().split()))
	print(view_check(n, heights))
__starting_point()


n = int(input())
L = list(map(int, input().split()))
m = 0
cnt = 0
for l in L:
	if m <= l:
		m = l
		cnt += 1
print(cnt)