N = int(input()) A = list(map(int, input().split())) left_upper = [1 for i in range(N)] left_downer = [1 for i in range(N)] right_upper = [1 for i in range(N)] right_downer = [1 for i in range(N)] for i in range(1, N): if A[i-1] < A[i]: left_upper[i] = left_upper[i-1] + 1 for i in range(1, N): if A[i-1] > A[i]: left_downer[i] = left_downer[i-1] + 1 A.reverse() for i in range(1, N): if A[i-1] < A[i]: right_upper[i] = right_upper[i-1] + 1 for i in range(1, N): if A[i-1] > A[i]: right_downer[i] = right_downer[i-1] + 1 ans = 0 for i in range(N): ans = max(ans, min(left_upper[i], right_upper[N-1-i]), min(left_downer[i], right_downer[N-1-i])) print(ans - 1)