import sys

n=int(input())
h=list(map(int,input().split()))
count=0
be=h[0]
maxcount=h.count(max(h))

for i in range(n):
  if be<=h[i] and h[0]<=h[i]:
    if h[i]==max(h):
      maxcount-=1
      count+=1
      if maxcount==0:
        break
    else:
      count+=1
  be=h[i]
  
print(count)