#yukicoder 921 ずんだアロー import math from collections import Counter N = int(input()) A = list(map(int,input().split())) if N == 1: print(1) exit() C = Counter(A) ans = 0 for i in range(N-1): if i == 0: if A[i] >= A[i+1]: ans += 1 else: if A[i] >= A[i+1] and A[i-1] <= A[i]: ans += 1 if i == N - 2 and A[i] <= A[i+1]: ans += 1 tmp = max(math.ceil(N / 2),max(C.values())) ans = max(ans,tmp) print(ans)