#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 A[i] >= A[i+1]:
        ans += 1
    if i == N - 2:
        if A[i] <= A[i+1]:
            ans += 1

tmp = max(math.ceil(N / 2),max(C.values()))
ans = max(ans,tmp)
print(ans)