You are given an array $a$ consisting of $n$ integers.

You can remove at most one element from this array. Thus, the final length of the array is $n-1$ or $n$.

Your task is to calculate the maximum possible length of the strictly increasing contiguous subarray of the remaining array.

Recall that the contiguous subarray $a$ with indices from $l$ to $r$ is $a[l \dots r] = a_l, a_{l + 1}, \dots, a_r$. The subarray $a[l \dots r]$ is called strictly increasing if $a_l < a_{l+1} < \dots < a_r$.


-----Input-----

The first line of the input contains one integer $n$ ($2 \le n \le 2 \cdot 10^5$) — the number of elements in $a$.

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$), where $a_i$ is the $i$-th element of $a$.


-----Output-----

Print one integer — the maximum possible length of the strictly increasing contiguous subarray of the array $a$ after removing at most one element.


-----Examples-----
Input
5
1 2 5 3 4

Output
4

Input
2
1 2

Output
2

Input
7
6 5 4 3 2 4 3

Output
2



-----Note-----

In the first example, you can delete $a_3=5$. Then the resulting array will be equal to $[1, 2, 3, 4]$ and the length of its largest increasing subarray will be equal to $4$.

Difficulty: MEDIUM
Tags: Dynamic programming

Complete search
Skill types: Dynamic programming

Complete search

Starter code:

Solutions:
import sys
from itertools import chain, permutations

def res(x):
	result = 1
	current = 1
	for i in range(1, len(x)):
		if x[i] > x[i - 1]:
			current = current + 1
			result = max(result, current)
		else:
			result = max(result, current)
			current = 1
		if result < current:
			current = result
	return result

def check(x):
	best = res(x)
	for pos in range(len(x)):
		new = x[:pos] + x[pos + 1:]
		best = max(best, res(new))
	return best
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split(' ')))

def solve(a, n):
	dp = [[1 for i in range(2)] for j in range(n)]
	dp[0][0] = 1
	dp[0][1] = 1
	for i in range(1, n):
		if a[i] > a[i - 1]:
			dp[i][0] = dp[i - 1][0] + 1
			dp[i][1] = dp[i - 1][1] + 1
		if i > 1 and a[i] > a[i - 2]:
			dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
	return max(chain(*dp))
print(solve(a, n))


n = int(input())
a = [int(o) for o in input().split()]
arr = [1] * n
upto = [1] * n
c = 1
for i in range(1, n):
	flag = 0
	if a[i - 1] < a[i]:
		c += 1
	else:
		flag = 1
		for j in range(i - c, i):
			arr[j] = c
			c -= 1
		c = 1
	upto[i] = c
	if i == n - 1 and flag == 0:
		for j in range(i - c + 1, i):
			arr[j] = c
			c -= 1
ca = max(arr)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ca = max(ca, upto[i - 1] + arr[i + 1])
print(ca)


n = int(input())
arr = [int(j) for j in input().split()]
arr += [-10 ** 18]
temp = []
count = [arr[0]]
for i in range(1, n + 1):
	if arr[i] <= arr[i - 1]:
		temp += [count]
		count = [arr[i]]
	else:
		count += [arr[i]]
ma = 0
for x in temp:
	if len(x) > ma:
		ma = len(x)
ans = []
for i in range(len(temp) - 1):
	kk = 0
	if len(temp[i]) != 1 and len(temp[i + 1]) != 1:
		if temp[i][-2] < temp[i + 1][0]:
			kk = len(temp[i]) + len(temp[i + 1]) - 1
		if temp[i][-1] < temp[i + 1][1]:
			kk = len(temp[i]) + len(temp[i + 1]) - 1
	elif len(temp[i]) != 1 and len(temp[i + 1]) == 1:
		if i != len(temp) - 2 and temp[i][-1] < temp[i + 2][0]:
			kk = len(temp[i] + len(temp[i + 2]))
	elif len(temp[i]) == 1 and len(temp[i + 1]) != 1:
		if i >= 1 and temp[i - 1][-1] < temp[i + 1][0]:
			kk = len(temp[i - 1]) + len(temp[i + 1])
	else:
		if i >= 1 and temp[i - 1][-1] < temp[i + 1][0]:
			kk = len(temp[i - 1]) + len(temp[i + 1])
		if i != len(temp) - 2 and temp[i][-1] < temp[i + 2][0]:
			kk = max(len(temp[i] + len(temp[i + 2])), kk)
	if kk != 0:
		ans += [kk]
if len(ans) == 0:
	ans = [-100]
print(max(max(ans), ma))


n = int(input())
a = list(map(int, input().split()))
b = a[::-1]
L1 = [1] * n
L2 = [1] * n
for i in range(n - 1):
	if a[i] < a[i + 1]:
		L1[i + 1] += L1[i]
for i in range(n - 1):
	if b[i] > b[i + 1]:
		L2[-i - 2] += L2[-i - 1]
ans = max(L1)
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, L1[i] + L2[i + 2])
print(ans)


n = map(int, input().split())
t = list(map(int, input().split()))
t_l = [1]
t_r = [1]
curr_wyn = 1
for x in range(1, len(t)):
	if t[x - 1] < t[x]:
		curr_wyn += 1
		t_l.append(curr_wyn)
	else:
		curr_wyn = 1
		t_l.append(curr_wyn)
curr_wyn = 1
for x in range(len(t) - 2, -1, -1):
	if t[x + 1] > t[x]:
		curr_wyn += 1
		t_r.append(curr_wyn)
	else:
		curr_wyn = 1
		t_r.append(curr_wyn)
t_r = t_r[::-1]
curr_wyn = 0
for x in range(len(t_l)):
	if max(t_l[x], t_r[x]) >= curr_wyn:
		curr_wyn = max(t_l[x], t_r[x])
	if x + 2 <= len(t_l) - 1:
		if t[x + 2] > t[x]:
			if t_l[x] + t_r[x + 2] >= curr_wyn:
				curr_wyn = t_l[x] + t_r[x + 2]
print(curr_wyn)


input()
(A, B, C) = ([int(_) for _ in input().split()], [1], [1])
for i in range(1, len(A)):
	if A[i] > A[i - 1]:
		B.append(B[-1] + 1)
		C.append(C[-1] + 1)
	else:
		B.append(1)
		C.append(1)
	if i >= 2 and A[i] > A[i - 2]:
		C[-1] = max(C[-1], B[i - 2] + 1)
print(max(*B, *C))


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	dpleft = []
	for i in range(n):
		if not dpleft:
			dpleft.append(1)
		elif arr[i] > arr[i - 1]:
			dpleft.append(dpleft[-1] + 1)
		else:
			dpleft.append(1)
	dpright = []
	for i in range(n - 1, -1, -1):
		if not dpright:
			dpright.append(1)
		elif arr[i] < arr[i + 1]:
			dpright.append(dpright[-1] + 1)
		else:
			dpright.append(1)
	dpright.reverse()
	ans = max(dpleft)
	for i in range(1, n - 1):
		if arr[i + 1] > arr[i - 1]:
			ans = max(ans, dpleft[i - 1] + dpright[i + 1])
	print(ans)
main()


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


n = int(input())
a = list(map(int, input().split()))
res = []
first = a[0]
temp = 1
for i in range(1, len(a)):
	if first < a[i]:
		temp += 1
	else:
		res.append((temp, i - 1))
		temp = 1
	first = a[i]
if temp >= 1:
	res.append((temp, len(a) - 1))
final_ans = []
for i in range(len(res) - 1):
	l = a[res[i][1] - 1]
	l2 = a[res[i][1]]
	f = a[res[i + 1][1] - res[i + 1][0] + 1]
	f2 = a[res[i + 1][1] - res[i + 1][0] + 1]
	if res[i + 1][0] >= 2:
		f2 = a[res[i + 1][1] - res[i + 1][0] + 2]
	if l < f or l2 < f2:
		final_ans.append(res[i][0] + res[i + 1][0] - 1)
	else:
		final_ans.append(max(res[i][0], res[i + 1][0]))
if len(final_ans) == 0:
	print(max(res[0]))
else:
	print(max(final_ans))


from math import *
import os, sys
from io import BytesIO
n = int(input())
a = list(map(int, input().split()))
dp = [0] * n
dp2 = [0] * n
dp[0] = 1
dp2[-1] = 1
ans = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dp2[i] = dp2[i + 1] + 1
	else:
		dp2[i] = 1
for i in range(n):
	ans = max(ans, dp[i] + dp2[i] - 1)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, dp[i - 1] + dp2[i + 1])
print(ans)


def solve():
	n = int(input())
	nums = [int(x) for x in input().split()]
	dp = [[1] * n for i in range(2)]
	flag = [0] * n
	if n == 0:
		print(0)
		return
	if n == 1:
		print(1)
		return
	if n == 2:
		if nums[0] < nums[1]:
			print(2)
		else:
			print(1)
		return
	dp[0][0] = 1
	dp[0][1] = 0
	if nums[0] < nums[1]:
		dp[0][1] = 2
	else:
		dp[0][1] = 1
	dp[1][1] = 1
	for i in range(2, n):
		if nums[i] > nums[i - 1]:
			dp[0][i] = dp[0][i - 1] + 1
			dp[1][i] = dp[1][i - 1] + 1
		if nums[i] > nums[i - 2]:
			dp[1][i] = max(dp[1][i], dp[0][i - 2] + 1)
	ans = 0
	for i in range(2):
		for j in range(n):
			ans = max(ans, dp[i][j])
	print(ans)
solve()


def main():
	buf = input()
	n = int(buf)
	buf = input()
	buflist = buf.split()
	a = list(map(int, buflist))
	sublen_inc = []
	sublen_dec = []
	for i in range(n):
		sublen_inc.append(None)
		sublen_dec.append(None)
	c = 1
	sublen_inc[0] = c
	for i in range(1, n):
		if a[i - 1] < a[i]:
			c += 1
		else:
			c = 1
		sublen_inc[i] = c
	c = 1
	sublen_dec[n - 1] = c
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			c += 1
		else:
			c = 1
		sublen_dec[i] = c
	best = max(sublen_inc)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			new_sublen = sublen_inc[i - 1] + sublen_dec[i + 1]
			if new_sublen > best:
				best = new_sublen
	print(best)
main()


from sys import stdin, stdout
n = int(stdin.readline())
fuad = [int(x) for x in stdin.readline().split()]
ans = int(0)
left = [1] * n
right = [1] * n
for i in range(1, n):
	if fuad[i - 1] < fuad[i]:
		left[i] = left[i - 1] + 1
	ans = max(left[i], ans)
for i in range(n - 2, -1, -1):
	if fuad[i] < fuad[i + 1]:
		right[i] = right[i + 1] + 1
for i in range(1, n - 1):
	if fuad[i - 1] < fuad[i + 1]:
		ans = max(ans, left[i - 1] + right[i + 1])
stdout.write(str(ans))


import sys
n = int(sys.stdin.readline())
a = [int(i) for i in sys.stdin.readline().split()]
if n == 1:
	print(1)
elif n == 2:
	if a[0] < a[1]:
		print(2)
	else:
		print(1)
else:
	arr = [0] * n
	par = [-1] * n
	ctr = 1
	ans = 1
	ind = 0
	for g in range(n - 1):
		if a[g] < a[g + 1]:
			ctr += 1
		else:
			arr[ind] = ctr
			par[ind] = ind
			ans = max(ans, ctr)
			ctr = 1
			ind = g + 1
	arr[ind] = ctr
	par[ind] = ind
	ans = max(ans, ctr)
	for h in range(n - 1):
		if arr[h + 1] == 0:
			arr[h + 1] = arr[h]
		if par[h + 1] == -1:
			par[h + 1] = par[h]
	for p in range(n - 2):
		if a[p] < a[p + 2] and par[p] != par[p + 2]:
			val = arr[p] + arr[p + 2]
			if a[p] < a[p + 1] or a[p + 1] < a[p + 2]:
				val -= 1
			ans = max(ans, val)
	print(ans)


n = int(input())
l = list(map(int, input().split()))
end = [1]
for i in range(1, n):
	if l[i] > l[i - 1]:
		end.append(end[-1] + 1)
	else:
		end.append(1)
strt = [1] * n
for i in range(n - 2, -1, -1):
	if l[i] < l[i + 1]:
		strt[i] = strt[i + 1] + 1
	else:
		strt[i] = 1
ans = max(max(end), max(strt))
for i in range(1, n - 1):
	if l[i + 1] > l[i - 1]:
		ans = max(ans, end[i - 1] + strt[i + 1])
print(ans)


from sys import stdin, stdout
import math
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	l = [1] * n
	r = [1] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			l[i] = l[i - 1] + 1
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			r[i] = r[i + 1] + 1
	ans = max(max(l), max(r))
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(ans, l[i - 1] + r[i + 1])
	print(ans)
tt = 1
for __ in range(tt):
	solve()


from fractions import gcd
from heapq import *
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7

def main():
	n = int(input())
	a = list(map(int, input().split()))
	l = []
	ind = []
	s = a[0]
	c = 1
	for i in range(1, n):
		if s < a[i]:
			c += 1
		else:
			l.append(c)
			ind.append(i - 1)
			c = 1
		s = a[i]
	l.append(c)
	ind.append(i)
	ans = max(l)
	for i in range(len(ind) - 1):
		j = ind[i]
		if j + 1 < n and a[j - 1] < a[j + 1]:
			ans = max(ans, l[i] + l[i + 1] - 1)
		if j + 2 < n and a[j] < a[j + 2]:
			ans = max(ans, l[i] + l[i + 1] - 1)
	print(ans)
main()


import sys
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
skip = [-1] * n
noskip = [-1] * n
noskip[0] = 1
prevskip = [-1] * n
ans = 1
z = True
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		noskip[i] = noskip[i - 1] + 1
		if z:
			skip[i] = skip[i - 1] + 1
		else:
			if arr[i] > arr[i - 2]:
				skip[i] = skip[i - 1] + 1
			else:
				skip[i] = 0
			z = True
		prevskip[i] = prevskip[i - 1] + 1
	elif i == 1:
		skip[i] = 1
		noskip[i] = 1
		prevskip[i] = 1
	else:
		if arr[i] > arr[i - 2]:
			prevskip[i] = noskip[i - 2] + 1
		noskip[i] = 1
		skip[i] = noskip[i - 1]
		z = False
	ans = max(ans, skip[i], noskip[i], prevskip[i])
print(ans)


from sys import stdin
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
asc = [1 for _ in range(n)]
des = [1 for _ in range(n)]
for i in range(1, n):
	if a[i] > a[i - 1]:
		asc[i] = asc[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		des[i] = des[i + 1] + 1
ans = max(max(asc), max(des))
for i in range(1, n - 1):
	if a[i + 1] > a[i - 1]:
		ans = max(ans, asc[i - 1] + des[i + 1])
print(ans)


import math
import random

def type1():
	return map(int, input().split())

def type2():
	return list(type1())

def type3():
	return int(input())
n = type3()
a = type2()
forward = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		forward[i] = forward[i - 1] + 1
backward = [1] * n
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		backward[i] = backward[i + 1] + 1
maxi = max(max(forward), max(backward))
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		maxi = max(maxi, forward[i - 1] + backward[i + 1])
print(maxi)


n = int(input())
a = [int(i) for i in input().split()]
l = [1] * n
r = [1] * n
m = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
		m = max(m, l[i])
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		r[i] = r[i + 1] + 1
		m = max(m, r[i])
for i in range(n - 2):
	if a[i] < a[i + 2]:
		m = max(m, l[i] + r[i + 2])
print(m)


n = int(input())
ar = [*map(int, input().split())]
lt = [1] * n
rt = [1] * n
ans = int(0)
for i in range(1, n):
	if ar[i - 1] < ar[i]:
		lt[i] = lt[i - 1] + 1
	ans = max(ans, lt[i])
for i in range(n - 2, -1, -1):
	if ar[i] < ar[i + 1]:
		rt[i] = rt[i + 1] + 1
	ans = max(ans, rt[i])
for i in range(1, n - 1):
	if ar[i - 1] < ar[i + 1]:
		ans = max(ans, lt[i - 1] + rt[i + 1])
print(ans)


import sys
input = sys.stdin.readline

def main():
	N = int(input())
	A = [int(x) for x in input().split()]
	AX = []
	for i in range(N):
		if i == 0:
			AX.append(1)
		elif A[i] > A[i - 1]:
			AX.append(AX[i - 1] + 1)
		else:
			AX.append(1)
	BX = [1] * N
	for i in range(N - 1, -1, -1):
		if i == N - 1:
			BX[i] = 1
		elif A[i + 1] > A[i]:
			BX[i] = BX[i + 1] + 1
		else:
			BX[i] = 1
	ans = max(AX)
	for i in range(N):
		if i == 0 or i == N - 1:
			continue
		if A[i - 1] < A[i + 1]:
			ans = max(ans, AX[i - 1] + BX[i + 1])
	print(ans)
main()


n = int(input())
a = list(map(int, input().split()))
count = [1] * n
countedit = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		count[i] = count[i - 1] + 1
		countedit[i] = countedit[i - 1] + 1
	if i > 1 and a[i] > a[i - 2] and (countedit[i] <= count[i - 2]):
		countedit[i] = count[i - 2] + 1
print(max(countedit))


n = int(input())
arr = list(map(int, input().split()))
incLen = list()
incS = list()
tempAns = 1
last = arr[0]
currS = 0
currLen = 1
for i in range(1, n):
	curr = arr[i]
	if curr > last:
		last = curr
		currLen += 1
	else:
		tempAns = max(tempAns, currLen)
		incLen.append(currLen)
		incS.append(currS)
		last = arr[i]
		currS = i
		currLen = 1
tempAns = max(tempAns, currLen)
incLen.append(currLen)
incS.append(currS)
for i in range(0, len(incLen) - 1):
	prevLast = arr[incS[i] + incLen[i] - 1]
	nextFirst = arr[incS[i + 1]]
	if incS[i] + incLen[i] - 2 >= 0 and incLen[i] >= 2:
		prevLLast = arr[incS[i] + incLen[i] - 2]
		if nextFirst > prevLLast:
			tempAns = max(tempAns, incLen[i] - 1 + incLen[i + 1])
	if incLen[i + 1] >= 2:
		nextFFirst = arr[incS[i + 1] + 1]
		if nextFFirst > prevLast:
			tempAns = max(tempAns, incLen[i] + incLen[i + 1] - 1)
print(tempAns)


n = int(input())
a = list(map(int, input().split()))
hehe = [1 for i in range(n)]
lol = [1 for i in range(n)]
for i in range(1, n):
	if a[i] > a[i - 1]:
		hehe[i] = 1 + hehe[i - 1]
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		lol[i] = 1 + lol[i + 1]
mx = 0
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		mx = max(mx, hehe[i - 1] + lol[i + 1])
	else:
		mx = max(mx, hehe[i - 1], lol[i + 1])
xx = max(hehe)
print(max(mx, xx))


n = int(input())
l = list(map(int, input().split()))
ans = 1
count = 1
t = 1
ind = -1
for i in range(n - 1):
	if l[i] < l[i + 1]:
		count += 1
	else:
		if ind == -1:
			ans = max(ans, count)
		elif l[ind - 1] < l[ind + 1] or l[ind] < l[ind + 2]:
			ans = max(ans, t + count - 1)
		else:
			ans = max(ans, t, count)
		t = count
		count = 1
		ind = i
if ind == -1:
	print(n)
else:
	if count != 1:
		if l[ind - 1] < l[ind + 1] or l[ind] < l[ind + 2]:
			ans = max(ans, t + count - 1)
		else:
			ans = max(ans, t, count)
	print(ans)


n = int(input())
incseq = [0]
seq = list(map(int, input().split()))
incseq[0] = [seq[0]]
for i in range(1, len(seq)):
	if seq[i] > seq[i - 1]:
		incseq[-1].append(seq[i])
	else:
		incseq.append([seq[i]])
seqLen = max((len(k) for k in incseq))
for i in range(1, len(incseq) - 1):
	if len(incseq[i]) == 1:
		if incseq[i - 1][-1] < incseq[i + 1][0]:
			seqLen = max(seqLen, len(incseq[i - 1]) + len(incseq[i + 1]))
	else:
		if incseq[i - 1][-1] < incseq[i][1]:
			seqLen = max(seqLen, len(incseq[i - 1]) + len(incseq[i]) - 1)
		if incseq[i][-2] < incseq[i + 1][0]:
			seqLen = max(seqLen, len(incseq[i + 1]) + len(incseq[i]) - 1)
if len(incseq) >= 2:
	if len(incseq[0]) != 1:
		if incseq[0][-2] < incseq[1][0]:
			seqLen = max(seqLen, len(incseq[1]) + len(incseq[0]) - 1)
	if len(incseq[-1]) != 1:
		if incseq[-2][-1] < incseq[-1][1]:
			seqLen = max(seqLen, len(incseq[-2]) + len(incseq[-1]) - 1)
print(seqLen)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
dpl = [0] * n
dpl[0] = 1
for i in range(1, n):
	if a[i - 1] < a[i]:
		dpl[i] = dpl[i - 1] + 1
	else:
		dpl[i] = 1
dpr = [0] * n
dpr[-1] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dpr[i] = dpr[i + 1] + 1
	else:
		dpr[i] = 1
ans = 0
for i in range(n):
	ans = max(ans, dpl[i] + dpr[i] - 1)
	if 1 <= i <= n - 2 and a[i - 1] < a[i + 1]:
		ans = max(ans, dpl[i - 1] + dpr[i + 1])
print(ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	ans = 1
	if n == 1:
		print(1)
		return
	dp = [1 for x in range(n + 1)]
	dpb = [1 for x in range(n + 1)]
	cnt = 1
	for x in range(1, n):
		if a[x] > a[x - 1]:
			cnt += 1
			dp[x] = cnt
		else:
			cnt = 1
	cnt = 1
	for x in range(n - 2, -1, -1):
		if a[x + 1] > a[x]:
			cnt += 1
			dpb[x] = cnt
		else:
			cnt = 1
	ans = 1
	for x in range(n):
		if x + 1 < n and x - 1 >= 0 and (a[x + 1] > a[x - 1]):
			ans = max(ans, dp[x - 1] + dpb[x + 1])
		ans = max(ans, dp[x], dpb[x])
	print(min(n, ans))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
a = list(map(int, input().split()))
ans = 0
left = [1] * n
right = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		left[i] = left[i - 1] + 1
	ans = max(ans, left[i])
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		right[i] = right[i + 1] + 1
	ans = max(ans, right[i])
for i in range(n - 2):
	if a[i + 2] > a[i]:
		ans = max(ans, left[i] + right[i + 2])
print(ans)


def maxIncSubarr(a, n):
	pre = [0] * n
	pos = [0] * n
	pre[0] = 1
	pos[n - 1] = 1
	l = 0
	for i in range(1, n):
		if a[i] > a[i - 1]:
			pre[i] = pre[i - 1] + 1
		else:
			pre[i] = 1
	l = 1
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			pos[i] = pos[i + 1] + 1
		else:
			pos[i] = 1
	ans = 0
	l = 1
	for i in range(1, n):
		if a[i] > a[i - 1]:
			l += 1
		else:
			l = 1
		ans = max(ans, l)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(pre[i - 1] + pos[i + 1], ans)
	return ans
n = int(input())
l = list(map(int, input().split()))
print(maxIncSubarr(l, n))


n = int(input())
a = list(map(int, input().split()))
b = a[::-1]
dpa = [1] * n
dpb = [1] * n
for i in range(n - 1):
	if a[i] < a[i + 1]:
		dpa[i + 1] += dpa[i]
for i in range(n - 1):
	if b[i] > b[i + 1]:
		dpb[-i - 2] += dpb[-i - 1]
ans = max(dpa)
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, dpa[i] + dpb[i + 2])
print(ans)


from copy import copy

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())

def comp(a):
	return a[0]
n = int_inp()
a = arr_int_inp()
F = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		F[i] = F[i - 1] + 1
F_new = [1] * n
F_new[-1] = F[-1]
for i in range(n - 1, 0, -1):
	if a[i - 1] < a[i]:
		F_new[i - 1] = F_new[i]
	else:
		F_new[i - 1] = F[i - 1]
ans = max(F)
for i in range(0, n - 2):
	if a[i + 2] > a[i]:
		ans = max(ans, F[i] + F_new[i + 2] - F[i + 2] + 1)
print(ans)


n = int(input())
li = list(map(int, input().split()))
arr = []
p = 0
b = []
ans = []
for i in range(n - 1):
	if p == 0:
		b.append(i)
		p = 1
	if li[i] < li[i + 1]:
		p += 1
	else:
		b.append(i)
		arr.append(b)
		ans.append(p)
		b = []
		p = 0
if p != 0:
	b.append(i + 1)
	arr.append(b)
	ans.append(p)
else:
	b.append(i + 1)
	b.append(i + 1)
	arr.append(1)
ans1 = max(ans)
for i in range(len(ans) - 1):
	if arr[i + 1][0] - arr[i][1] == 1:
		if arr[i][1] != 0:
			if li[arr[i][1] - 1] < li[arr[i + 1][0]]:
				ans1 = max(ans1, ans[i] - 1 + ans[i + 1])
		if arr[i + 1][0] != n - 1:
			if li[arr[i][1]] < li[arr[i + 1][0] + 1]:
				ans1 = max(ans1, ans[i] - 1 + ans[i + 1])
print(ans1)


R = lambda : map(int, input().split())
n = int(input())
arr = list(R()) + [0]
(left, right) = ([0] * (n + 1), [0] * (n + 1))
for i in range(n):
	left[i] = left[i - 1] + 1 if arr[i] > arr[i - 1] else 1
for i in range(n - 1, -1, -1):
	right[i] = right[i + 1] + 1 if arr[i] < arr[i + 1] else 1
res = max(left + right)
for i in range(1, n - 1):
	res = max(res, left[i - 1] + right[i + 1] if arr[i - 1] < arr[i + 1] else 0)
print(res)


import math
import os
import sys
input = lambda : sys.stdin.readline().strip('\r\n')

def cin():
	return sys.stdin.readline().strip('\r\n')

def fora():
	return list(map(int, sys.stdin.readline().strip().split()))

def string():
	return sys.stdin.readline().strip()

def cout(ans):
	sys.stdout.write(str(ans))

def endl():
	sys.stdout.write(str('\n'))

def ende():
	sys.stdout.write(str(' '))

def right(n, a, i, cnt):
	j = i + 2
	cnt += 1
	while j < n - 1:
		if a[j + 1] > a[j]:
			cnt += 1
		else:
			return cnt
		j += 1
	return cnt

def curr(n, a, i, cnt):
	j = i + 1
	cnt += 1
	while j < n - 1:
		if a[j + 1] > a[j]:
			cnt += 1
		else:
			return cnt
		j += 1
	return cnt

def main():
	n = int(cin())
	a = fora()
	i = 0
	cnt = 1
	flag = 1
	l = []
	l.append(1)
	while i < n - 1:
		if a[i + 1] > a[i]:
			cnt += 1
		else:
			if i < n - 2 and a[i] < a[i + 2]:
				prevcnt = cnt
				l.append(right(n, a, i, prevcnt))
			if cnt > 1 and a[i - 1] < a[i + 1]:
				prevcnt = cnt - 1
				l.append(curr(n, a, i, prevcnt))
			l.append(cnt)
			cnt = 1
		i += 1
	l.append(cnt)
	cout(max(l))
	endl()
main()


n = int(input())
a = list(map(int, input().split()))
b = list(reversed(a))
dp = [1] * n
dp1 = [1] * n
for i in range(n - 1):
	dp[-i - 2] += dp[-i - 1] * int(b[i] > b[i + 1])
for i in range(n - 1):
	dp1[i + 1] += dp1[i] * int(a[i] < a[i + 1])
ans = max(dp1)
for i in range(n - 2):
	ans = max(ans, (dp1[i] + dp[i + 2]) * int(a[i] < a[i + 2]))
print(ans)


n = int(input())
a = list(map(int, input().split()))
inc = []
curinc = 1
curincmax = []
gap = 0
gaps = []
maxinc = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		if gap > 0:
			if gap == 1 and a[i - 1] > a[i - 3]:
				gaps.append(len(inc))
			gap = 0
		curinc += 1
	else:
		gap += 1
		inc.append(curinc)
		maxinc = max(curinc, maxinc)
		curinc = 1
inc.append(curinc)
maxinc = max(curinc, maxinc)
total = 0
special = 0
for e in range(len(inc)):
	each = inc[e]
	total += each
	if total + 1 < n and a[total - 1] < a[total + 1]:
		special = max(special, inc[e] + inc[e + 1] - 1)
	elif total - 2 >= 0 and total < n and (a[total - 2] < a[total]):
		special = max(special, inc[e] + inc[e + 1] - 1)
print(max(special, maxinc))


import sys

def read_ints():
	return [int(x) for x in sys.stdin.readline().strip().split()]

def main():
	N = read_ints()[0]
	nums = read_ints()
	pref = [0] * N
	suf = [0] * N
	pref[0] = 1
	ans = 1
	for ix in range(1, N):
		pref[ix] = 1 + (pref[ix - 1] if nums[ix] > nums[ix - 1] else 0)
		ans = max(ans, pref[ix])
	suf[N - 1] = 1
	for ix in range(N - 2, -1, -1):
		suf[ix] = 1 + (suf[ix + 1] if nums[ix] < nums[ix + 1] else 0)
	for to_delete in range(1, N - 1):
		if nums[to_delete - 1] < nums[to_delete + 1]:
			ans = max(pref[to_delete - 1] + suf[to_delete + 1], ans)
	print(ans)
main()


n = int(input())
list1 = list(map(int, input().split()))
left = []
right = []
for i in range(n):
	left.append(1)
	right.append(1)
for i in range(1, n):
	if list1[i] > list1[i - 1]:
		left[i] = left[i - 1] + 1
for i in range(n - 2, -1, -1):
	if list1[i] < list1[i + 1]:
		right[i] = right[i + 1] + 1
maxi = 0
if max(left) > max(right):
	maxi = max(left)
else:
	maxi = max(right)
for i in range(n - 2):
	if list1[i] < list1[i + 2]:
		maxi = max(maxi, left[i] + right[i + 2])
print(maxi)


n = int(input())
l = list(map(int, input().split()))
ans = []
v = []
x = []
for t in range(len(l)):
	if len(v) == 0:
		v.append(l[t])
	elif l[t] > l[t - 1]:
		v.append(l[t])
	else:
		ans.append(v)
		v = [l[t]]
	if t == len(l) - 1:
		ans.append(v)
x.append(len(ans[-1]))
for i in range(len(ans) - 1):
	x.append(len(ans[i]))
	if len(ans[i]) > 1 and ans[i][-2] < ans[i + 1][0]:
		x.append(len(ans[i]) + len(ans[i + 1]) - 1)
	if len(ans[i + 1]) > 1 and ans[i + 1][1] > ans[i][-1]:
		x.append(len(ans[i]) + len(ans[i + 1]) - 1)
print(max(x))


n = int(input())
arr = list(map(int, input().split()))
l = [1 for i in range(n)]
r = [1 for i in range(n)]
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		l[i] = l[i - 1] + 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		r[i] = r[i + 1] + 1
ans = max(l)
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(ans, r[i + 1] + l[i - 1])
print(ans)


n = int(input())
x = list(map(int, input().split()))
(dp, dp2, num, ans) = ([0] * 200005, [0] * 200005, 1, 0)
for i in range(n):
	if i != 0:
		if x[i] > x[i - 1]:
			num += 1
		else:
			num = 1
	dp[i] = num
num = 1
for i in range(n - 1, -1, -1):
	if i != n - 1:
		if x[i] < x[i + 1]:
			num += 1
		else:
			num = 1
	dp2[i] = num
for i in range(n):
	if ans < dp2[i]:
		ans = dp2[i]
	if ans < dp[i - 1] + dp2[i + 1] and x[i - 1] < x[i + 1]:
		ans = dp[i - 1] + dp2[i + 1]
print(ans)


n = int(input())
a = [-1] + list(map(int, input().split()))
cur = 0
l = [0] * n
m = [0] * n
for i in range(1, n + 1):
	if a[i] > a[i - 1]:
		cur += 1
	else:
		cur = 1
	l[i - 1] = cur
cur = n - 1
num = l[cur]
while cur >= 0:
	m[cur] = num
	if l[cur] == 1:
		num = l[cur - 1]
	cur -= 1
res = max(m)
a = a[1:]
for i in range(1, n - 1):
	if l[i - 1] + 2 != l[i + 1] and a[i - 1] < a[i + 1]:
		res = max(res, m[i - 1] + m[i + 1] - 1)
print(res)


n = int(input())
dp = [[0, 0] for i in range(n)]
dp[0] = [1, 1]
t = list(map(int, input().split()))
for j in range(1, n):
	if t[j] > t[j - 1]:
		dp[j][0] = dp[j - 1][0] + 1
		dp[j][1] = dp[j - 1][1] + 1
	else:
		dp[j][0] = 1
		dp[j][1] = 1
	if j >= 2 and t[j] > t[j - 2]:
		dp[j][1] = max(dp[j][1], dp[j - 2][0] + 1)
ans = 0
for i in dp:
	ans = max(ans, max(i))
print(ans)


n = int(input())
s = input()
l = list(map(int, s.split()))
records = []
current = 1
for i in range(1, len(l)):
	if l[i - 1] < l[i]:
		current += 1
	if l[i - 1] >= l[i]:
		records.append(current)
		append0 = False
		if i > 1 and l[i] <= l[i - 2]:
			append0 = True
		if i < len(l) - 1 and l[i - 1] < l[i + 1]:
			append0 = False
		if append0:
			records.append(0)
		current = 1
records.append(current)
mx = records[0]
for i in range(1, len(records)):
	mx = max(mx, records[i] + records[i - 1] - 1, records[i])
print(mx)


n = int(input())
l = list(map(int, input().split()))
maa = 0
arr = [1] * n
for i in range(1, n):
	if l[i] > l[i - 1]:
		arr[i] = arr[i - 1] + 1
arr2 = [1] * n
for i in range(1, n):
	if l[n - i - 1] < l[n - i]:
		arr2[n - i - 1] = arr2[n - i] + 1
maa = max(arr)
for i in range(1, n - 1):
	if l[i + 1] > l[i - 1]:
		maa = max(maa, arr[i - 1] + arr2[i + 1])
print(maa)


n = int(input())
l = [int(i) for i in input().split()]
dp = []
for i in range(n):
	dp.insert(len(dp), 1)
ma = 1
for i in range(1, n):
	if l[i] > l[i - 1]:
		dp[i] += dp[i - 1]
		ma = max(ma, dp[i])
	else:
		j = i - 1
		while j > 0 and l[j] > l[j - 1]:
			dp[j - 1] = dp[j]
			j -= 1
j = n - 1
k = 0
while j > 0 and l[j] > l[j - 1]:
	dp[j - 1] = dp[j]
	j -= 1
for i in range(2, n):
	if l[i - 2] < l[i] and (l[i - 1] >= l[i] or l[i - 2] > l[i - 1]):
		ma = max(ma, dp[i] + dp[i - 2] - 1)
print(ma)


def process(A):
	answer = 1
	n = len(A)
	current = [[A[0], A[0], 0, 0]]
	for i in range(1, n):
		if A[i] <= current[-1][1]:
			answer = max(answer, current[-1][3] - current[-1][2] + 1)
			current.append([A[i], A[i], i, i])
		else:
			current[-1][1] = A[i]
			current[-1][3] = i
	answer = max(answer, current[-1][3] - current[-1][2] + 1)
	m = len(current)
	for i in range(m - 1):
		(s1, e1, i1, i2) = current[i]
		(s2, e2, j1, j2) = current[i + 1]
		if i2 > 0 and A[i2 - 1] < A[j1]:
			answer = max(answer, j2 - j1 + i2 - i1 + 1)
		if j1 < j2 and A[i2] < A[j1 + 1]:
			answer = max(answer, j2 - j1 + i2 - i1 + 1)
	for i in range(m - 2):
		(s1, e1, i1, i2) = current[i]
		(s2, e2, j1, j2) = current[i + 1]
		(s3, e3, k1, k2) = current[i + 2]
		if j1 == j2 and A[i2] < A[k1]:
			answer = max(answer, k2 - k1 + 1 + i2 - i1 + 1)
	return answer
n = int(input())
A = [int(x) for x in input().split()]
print(process(A))


n = int(input())
a = list(map(int, input().split()))
(begin, end) = ([1] * n, [1] * n)
for i in range(1, n):
	if a[i] > a[i - 1]:
		end[i] = end[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		begin[i] = begin[i + 1] + 1
ans = end[-1]
for i in range(1, n - 1):
	ans = max(ans, end[i])
	if a[i - 1] < a[i + 1]:
		ans = max(ans, end[i - 1] + begin[i + 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.append
end = [1] * n
start = [1] * n
tot = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		end[i] = end[i - 1] + 1
		tot = max(tot, end[i])
	else:
		end[i] = 1
i = n - 2
while i >= 0:
	if a[i] < a[i + 1]:
		start[i] = start[i + 1] + 1
	else:
		start[i] = 1
	i = i - 1
i = n - 2
while i > 0:
	if a[i + 1] - a[i - 1] >= 1:
		tot = max(tot, end[i - 1] + start[i + 1])
	i = i - 1
print(max(tot, start[0]))


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input().strip()
mod = 1000000007
n = I()
a = li()
left = [1] * n
right = [1] * n
m = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		left[i] = left[i - 1] + 1
	m = max(m, left[i])
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		right[i] = right[i + 1] + 1
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		m = max(m, left[i - 1] + right[i + 1])
print(m)


n = int(input())
num = [int(x) for x in input().split()]
f = []
for i in range(n):
	f.append([1, 0, 0])
for i in range(1, n):
	if num[i] > num[i - 1]:
		f[i][0] = f[i - 1][0] + 1
		f[i][1] = f[i - 1][0]
		f[i][2] = f[i - 1][2] + 1
		if i >= 2 and num[i] > num[i - 2]:
			f[i][2] = max(f[i][2], f[i - 1][1] + 1)
	else:
		f[i][0] = 1
		f[i][1] = f[i - 1][0]
		if i >= 2 and num[i] > num[i - 2]:
			f[i][2] = max(f[i][2], f[i - 1][1] + 1)
ans = 0
for i in range(0, n):
	ans = max(ans, max(f[i][0], max(f[i][1], f[i][2])))
print(ans)


n = int(input())
a = input().split()
b = []
for i in a:
	b.append(int(i))
last = b[0]
section = [b[0]]
sections = []
for i in b[1:]:
	if i > last:
		section.append(i)
	else:
		sections.append(section)
		section = [i]
	last = i
sections.append(section)
ans = 0
for i in sections:
	ans = max(ans, len(i))
Last_section = sections[0]
for i in sections[1:]:
	if len(i) > 1 and len(Last_section) > 1:
		if Last_section[-2] < i[0] or Last_section[-1] < i[1]:
			ans = max(ans, len(i) + len(Last_section) - 1)
	Last_section = i
print(ans)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
n = int(input())
l = list(map(int, input().split()))
z = [[0]]
m = 1
for i in range(1, n):
	if l[i] > l[i - 1]:
		if i == n - 1:
			z[-1].append(i)
		pass
	elif i != n - 1:
		z[-1].append(i - 1)
		z.append([i])
	else:
		z[-1].append(n - 2)
		z.append([i, i])
for i in z:
	m = max(i[1] - i[0] + 1, m)
for i in range(1, len(z)):
	x = z[i - 1][1]
	if l[x - 1] < l[z[i][0]]:
		m = max(m, z[i][1] - z[i - 1][0])
	if z[i][0] + 1 < n and l[x] < l[z[i][0] + 1]:
		m = max(m, z[i][1] - z[i - 1][0])
print(m)


n = int(input())
a = list(map(int, input().split()))
pref = [0] * n
suff = [0] * n
pref[0] = 1
suff[-1] = 1
l = 0
r = n - 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		pref[i] = i - l + 1
	else:
		l = i
		pref[i] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suff[i] = r - i + 1
	else:
		r = i
		suff[i] = 1
ans = max(pref)
for i in range(n):
	if i == 0:
		ans = max(ans, suff[1])
	elif i == n - 1:
		ans = max(ans, pref[n - 2])
	elif a[i - 1] < a[i + 1]:
		ans = max(ans, pref[i - 1] + suff[i + 1])
print(ans)


n = int(input())
max_length = 0
curr_length = 0
prev_length = 0
(curr_first, curr_second) = (None, None)
(curr_last, curr_prelast) = (None, None)
(prev_last, prev_prelast) = (None, None)
prev = 0
seq = list(map(int, input().split()))
for i in range(n):
	curr = seq[i]
	if curr > prev:
		curr_length += 1
		if curr_length == 1:
			curr_first = curr
		elif curr_length == 2:
			curr_second = curr
		(curr_prelast, curr_last) = (curr_last, curr)
	if curr <= prev or i == n - 1:
		if prev_length <= 1 or curr_length <= 1:
			max_length = max(max_length, curr_length, prev_length)
		elif curr_first > prev_prelast or curr_second > prev_last:
			max_length = max(max_length, curr_length + prev_length - 1)
		else:
			max_length = max(max_length, curr_length, prev_length)
		(prev_length, curr_length) = (curr_length, 1)
		(prev_last, prev_prelast) = (curr_last, curr_prelast)
		(curr_first, curr_second) = (curr, None)
		(curr_last, curr_prelast) = (curr, None)
	prev = curr
print(max_length)


n = int(input())
s = [int(x) for x in input().split()]
ptr = 0
c = 1
L = [0] * len(s)
L[0] = 1
P = [0] * len(s)
for i in range(1, len(s)):
	if s[i] <= s[i - 1]:
		for j in range(ptr, i):
			P[j] = c
		c = 1
		ptr = i
	else:
		c += 1
	L[i] = c
for j in range(ptr, len(s)):
	P[j] = c
ans = max(P)
for i in range(1, len(s) - 1):
	if s[i - 1] < s[i + 1]:
		ans = max(ans, L[i - 1] + P[i + 1] - L[i + 1] + 1)
print(ans)


import sys
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
pref = [1]
suff = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		pref.append(pref[-1] + 1)
	else:
		pref.append(1)
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suff[i] += suff[i + 1]
ans = max(max(pref), max(suff))
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, pref[i] + suff[i + 2])
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
vals = list(map(int, input().split()))
chain = 1
chains = []
left = 0
right = 0
for s in range(1, n):
	if vals[s] > vals[s - 1]:
		chain += 1
		right = s
	else:
		if chain >= 1:
			chains.append((left, right))
		left = s
		right = s
		chain = 1
if len(chains) > 0:
	if chains[-1][1] != n - 1:
		chains.append((left, right))
else:
	chains.append((left, right))
length = 0
if len(chains) >= 2:
	for s in range(len(chains)):
		int1 = chains[s]
		need = int1[0] - 2
		if need >= 0:
			int2 = chains[s - 1]
			if int2[0] <= need and need <= int2[1]:
				if vals[need] < vals[int1[0]]:
					d1 = int1[1] + 1 - int1[0] + (need + 1 - int2[0])
					if d1 > length:
						length = d1
				else:
					d1 = int1[1] + 1 - int1[0]
					if d1 > length:
						length = d1
			else:
				int3 = chains[s - 2]
				if int3[0] <= need and need <= int3[1]:
					if vals[need] < vals[int1[0]]:
						d1 = int1[1] + 1 - int1[0] + (need + 1 - int3[0])
						if d1 > length:
							length = d1
					else:
						d1 = int1[1] + 1 - int1[0]
						if d1 > length:
							length = d1
				else:
					d1 = int1[1] + 1 - int1[0]
					if d1 > length:
						length = d1
		else:
			d1 = int1[1] + 1 - int1[0]
			if d1 > length:
				length = d1
		need1 = int1[1] + 2
		if need1 <= len(vals) - 1:
			int2 = chains[s + 1]
			if int2[0] <= need1 and need1 <= int2[1]:
				if vals[int1[1]] < vals[need1]:
					d1 = int2[1] + 1 - need1 + (int1[1] + 1 - int1[0])
					if d1 > length:
						length = d1
				else:
					d1 = int1[1] + 1 - int1[0]
					if d1 > length:
						length = d1
			else:
				int3 = chains[s + 2]
				if int3[0] <= need1 and need1 <= int3[1]:
					if vals[int1[1]] < vals[need1]:
						d1 = int3[1] + 1 - need1 + (int1[1] + 1 - int1[0])
						if d1 > length:
							length = d1
					else:
						d1 = int1[1] + 1 - int1[0]
						if d1 > length:
							length = d1
				else:
					d1 = int1[1] + 1 - int1[0]
					if d1 > length:
						length = d1
		else:
			d1 = int1[1] + 1 - int1[0]
			if d1 > length:
				length = d1
else:
	length = chains[0][1] + 1 - chains[0][0]
print(length)


import sys

def solve():
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr.append(0)
	subarr = list()
	sappend = subarr.append
	start = 0
	prev = arr[start]
	index = 1
	mx = 0
	while index <= n:
		cur = arr[index]
		if cur <= prev:
			sappend((start, index - 1))
			mx = max(mx, index - 1 - start + 1)
			start = index
		prev = arr[index]
		index += 1
	for i in range(1, len(subarr), 1):
		(cur_start, cur_end) = subarr[i]
		(prev_start, prev_end) = subarr[i - 1]
		cur_le = cur_end - cur_start + 1
		prev_le = prev_end - prev_start + 1
		if cur_le > 1:
			if prev_le > 1 and arr[prev_end - 1] < arr[cur_start] or arr[prev_end] < arr[cur_start + 1]:
				mx = max(mx, cur_le + prev_le - 1)
	print(mx)
solve()


N = int(input())
a = list(map(int, input().split()))
dp = [[1] * 2 for i in range(N)]
ans = 0
for i in range(N):
	if i == 0:
		continue
	else:
		if a[i - 1] < a[i]:
			dp[i][0] = max(dp[i][0], dp[i - 1][0] + 1)
			dp[i][1] = max(dp[i][1], dp[i - 1][1] + 1)
		if i > 1 and a[i - 2] < a[i]:
			dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
		ans = max(ans, dp[i][0], dp[i][1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
d = []
for i in range(0, n - 1):
	d.append(a[i + 1] - a[i])
i = 0
flag = 0
j = 0
t = []
while i < n - 1:
	count = 0
	while i < n - 1 and d[i] > 0:
		i = i + 1
		count = count + 1
	t.append([i, count + 1])
	if i == n - 1 and count + 1 == n:
		flag = 1
	i = i + 1
m = 0
k = i
i = 0
for i in range(0, len(t) - 1):
	if d[t[i][0] + 1] > 0 and (a[t[i][0] + 1] > a[t[i][0] - 1] or a[t[i][0] + 2] > a[t[i][0]]):
		c = t[i][1] + t[i + 1][1] - 1
	else:
		c = t[i][1]
	if c > m:
		m = c
if len(t) != 1:
	if d[t[i][0] + 1] > 0 and (a[t[i][0] + 1] > a[t[i][0] - 1] or a[t[i][0] + 2] > a[t[i][0]]):
		c = t[i][1] + t[i + 1][1] - 1
	else:
		c = t[i][1]
		c2 = t[i + 1][1]
		c = max(c, c2)
	if c > m:
		m = c
if len(t) == 1:
	if k == n - 1:
		m = n - 1
if flag == 0:
	print(m)
else:
	print(n)


def answer(n, A):
	l = [1] * n
	for i in range(1, n):
		if A[i] > A[i - 1]:
			l[i] = l[i - 1] + 1
	r = [1] * n
	for i in range(n - 2, -1, -1):
		if A[i] < A[i + 1]:
			r[i] = r[i + 1] + 1
	ans = 0
	for i in range(0, n):
		if i <= n - 3 and A[i + 2] > A[i]:
			ans = max(ans, l[i] + r[i + 2])
		else:
			ans = max(ans, l[i])
	return ans
n = int(input())
arr = list(map(int, input().split()))
print(answer(n, arr))


n = int(input())
a = [int(i) for i in input().split()]
b = [[1 for i in range(n)] for j in range(2)]
if a[0] < a[1]:
	b[0][1] = 2
for i in range(2, n):
	count1 = 0
	if a[i - 1] < a[i]:
		b[0][i] = b[0][i - 1] + 1
		count1 = b[1][i - 1] + 1
	count2 = 0
	if a[i - 2] < a[i]:
		count2 = b[0][i - 2] + 1
	b[1][i] = max(count2, count1)
print(max(max(b[0]), max(b[1])))


n = int(input())
A = list(map(int, input().split()))
R = [1] * n
L = [1] * n
for i in reversed(range(n - 1)):
	if A[i] < A[i + 1]:
		R[i] = R[i + 1] + 1
for i in range(1, n):
	if A[i - 1] < A[i]:
		L[i] = L[i - 1] + 1
ans = max(L)
for i in range(1, n - 1):
	if A[i - 1] < A[i + 1]:
		ans = max(ans, L[i - 1] + R[i + 1])
print(ans)


import math
import sys
from collections import defaultdict, Counter, deque, OrderedDict
import bisect
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]
from itertools import accumulate, groupby

def groupSequence(lst):
	res = [[lst[0]]]
	for i in range(1, len(lst)):
		if lst[i - 1] < lst[i]:
			res[-1].append(lst[i])
		else:
			res.append([lst[i]])
	return res
N = int(input())
A = alele()
B = groupSequence(A)
Ans = len(B[0])
for i in range(1, len(B)):
	x = len(B[i])
	Ans = max(Ans, x)
	if len(B[i - 1]) > 1 and B[i - 1][-2] < B[i][0]:
		Ans = max(Ans, len(B[i - 1]) + x - 1)
	if x > 1 and B[i][1] > B[i - 1][-1]:
		Ans = max(Ans, len(B[i - 1]) + x - 1)
print(Ans)


import sys
import bisect as bi
import math
from collections import defaultdict as dd
input = sys.stdin.readline

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(1):
	n = inin()
	l = ain()
	pre = [0] * n
	post = [0] * n
	pre[0] = 1
	post[-1] = 1
	for i in range(1, n):
		if l[i - 1] < l[i]:
			pre[i] = pre[i - 1] + 1
		else:
			pre[i] = 1
	for i in range(n - 2, -1, -1):
		if l[i + 1] > l[i]:
			post[i] = post[i + 1] + 1
		else:
			post[i] = 1
	if n == 2:
		if l[0] < l[1]:
			print(2)
		else:
			print(1)
	else:
		ans = 1
		for i in range(0, n):
			if i == 0:
				ans = max(ans, post[1], post[0])
			elif i == n - 1:
				ans = max(ans, pre[-2], pre[-1])
			elif l[i + 1] > l[i - 1]:
				ans = max(pre[i - 1] + post[i + 1], ans, pre[i])
			else:
				ans = max(ans, pre[i])
		print(ans)


n = int(input())
a = [int(x) for x in input().split()]
a += [0]
dp = [0] * (n + 5)
i = n - 2
dp[n - 1] = 1
while i >= 0:
	if a[i] < a[i + 1]:
		dp[i] = dp[i + 1] + 1
	else:
		dp[i] = 1
	i -= 1
temp = 1
ans = 1
for i in range(1, n):
	if a[i + 1] > a[i - 1]:
		ans = max(ans, temp + dp[i + 1])
	if a[i] > a[i - 1]:
		temp += 1
	else:
		temp = 1
	ans = max(ans, temp)
print(ans)


from sys import stdin
n = int(input())
l = list(map(int, stdin.readline().rstrip().split(' ')))
a = [1] * n
b = [1] * n
r = 0
for i in range(1, n):
	if l[i] > l[i - 1]:
		a[i] = a[i - 1] + 1
		b[i] = b[i - 1] + 1
	if i > 1 and l[i] > l[i - 2]:
		b[i] = max(b[i], a[i - 2] + 1)
	r = max(r, max(b[i], a[i]))
print(r)


n = int(input())
l = [int(x) for x in input().split()]
dp = [[1 for i in range(n)] for j in range(2)]
if l[1] > l[0]:
	dp[0][1] = 2
for i in range(2, n):
	if l[i] > l[i - 1]:
		dp[0][i] = dp[0][i - 1] + 1
	a = 0
	if l[i] > l[i - 2]:
		a = dp[0][i - 2] + 1
	b = 0
	if l[i] > l[i - 1]:
		b = dp[1][i - 1] + 1
	dp[1][i] = max(a, b)
print(max(max(dp[0]), max(dp[1])))


n = int(input())
a = [int(x) for x in input().split()]
end = [0] * n
beg = [0] * n
for i in range(n):
	if i > 0 and a[i] > a[i - 1]:
		end[i] = end[i - 1] + 1
	else:
		end[i] = 1
for i in reversed(range(n)):
	if i < n - 1 and a[i] < a[i + 1]:
		beg[i] = beg[i + 1] + 1
	else:
		beg[i] = 1
best = max(beg)
for i in range(n):
	if i == 0 or i == n - 1 or a[i - 1] < a[i + 1]:
		x = end[i - 1] if i > 0 else 0
		y = beg[i + 1] if i < n - 1 else 0
		if x + y > best:
			best = x + y
print(best)


from sys import stdin
input = stdin.readline
from heapq import heapify, heappush, heappop, heappushpop
from collections import defaultdict as dd, deque as dq, Counter as C
from math import factorial as f, ceil, gcd, sqrt, log
from bisect import bisect_left as bl, bisect_right as br
from itertools import combinations as c, permutations as p
from math import factorial as f, ceil, gcd, sqrt, log
mp = lambda : map(int, input().split())
it = lambda : int(input())
ls = lambda : list(input().strip())
mt = lambda r: [list(mp()) for _ in range(r)]
lcm = lambda a, b: a * b // gcd(a, b)

def fibo_n(n):
	return ((1 + sqrt(5)) / 2) ** n / sqrt(5)
mod = 1000000007
a = it()
b = list(mp())
v1 = [1] * a
mx = 0
for i in range(1, a):
	if b[i] > b[i - 1]:
		v1[i] = v1[i - 1] + 1
	mx = max(v1[i], mx)
v2 = [1] * a
for j in range(a - 2, -1, -1):
	if b[j] < b[j + 1]:
		v2[j] = v2[j + 1] + 1
	mx = max(v2[j], mx)
for k in range(2, a - 1):
	if b[k - 1] < b[k + 1]:
		mx = max(mx, v1[k - 1] + v2[k + 1])
print(mx)


n = int(input())
a = [int(i) for i in input().split()]
(pre, suf) = ([1] * n, [1] * n)
ans = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suf[i] = suf[i + 1] + 1
	ans = max(ans, suf[i])
for i in range(1, n):
	if a[i] > a[i - 1]:
		pre[i] = pre[i - 1] + 1
	ans = max(ans, pre[i])
for i in range(1, n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, pre[i] + suf[i + 2])
print(ans)


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
mod = 10 ** 7 + 1
n = int(ri())
a = RI()
l = [1] * len(a)
r = [1] * len(a)
ans = -1
for i in range(1, len(a)):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
	ans = max(ans, l[i])
for i in range(len(a) - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] = 1 + r[i + 1]
	ans = max(ans, r[i])
for i in range(0, len(a) - 2):
	if a[i + 2] > a[i]:
		ans = max(ans, l[i] + r[i + 2])
print(ans)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
n = rint()
a = rints()
rng = []
l = 0
for i in range(1, len(a)):
	if a[i] <= a[i - 1]:
		rng.append((l, i))
		l = i
rng.append((l, n))
mx = max((r - l for (l, r) in rng))
for i in range(len(rng) - 1):
	(l1, r1) = rng[i]
	(l2, r2) = rng[i + 1]
	if r1 - l1 == 1 or r2 - l2 == 1:
		continue
	if a[r1 - 2] < a[l2] or a[r1 - 1] < a[l2 + 1]:
		mx = max(mx, r2 - l1 - 1)
print(mx)


n = int(input())
ai = list(map(int, input().split()))
ans = [[0] * n for i in range(4)]
ans[0][0] = 1
ans[1][0] = ai[0]
for i in range(1, n):
	if ans[1][i - 1] < ai[i] and ans[3][i - 1] < ai[i]:
		ans[0][i] = ans[0][i - 1] + 1
		ans[1][i] = ai[i]
		ans[2][i] = ans[2][i - 1] + 1
		ans[3][i] = ai[i]
	elif ans[1][i - 1] < ai[i]:
		ans[0][i] = ans[0][i - 1] + 1
		ans[1][i] = ai[i]
		ans[2][i] = ans[0][i] - 1
		ans[3][i] = ai[i]
	else:
		if i > 1 and ans[1][i - 2] < ai[i]:
			ans[3][i] = ai[i]
		else:
			ans[3][i] = ans[1][i - 1]
		ans[2][i] = ans[0][i - 1]
		ans[0][i] = 1
		ans[1][i] = ai[i]
print(max(max(ans[2]), max(ans[0])))


import math
from math import log2, sqrt
from bisect import bisect_left, bisect_right
import bisect
import sys
from sys import stdin, stdout
import os
sys.setrecursionlimit(pow(10, 6))
import collections
from collections import defaultdict
from statistics import median
inf = float('inf')

def fun(l, n):
	prefix = [0] * n
	for i in range(1, len(l)):
		if l[i] > l[i - 1]:
			prefix[i] = prefix[i - 1] + 1
	return prefix

def rev_fun(l, n):
	suffix = [0] * n
	for i in range(len(l) - 1 - 1, 0, -1):
		if l[i] < l[i + 1]:
			suffix[i] = suffix[i + 1] + 1
	return suffix

def generate(l, prefix, suffix):
	ans = 1
	for i in range(len(prefix)):
		if i == 0:
			ans = max(ans, suffix[i + 1] + 1)
		elif i == n - 1:
			ans = max(ans, prefix[i - 1] + 1)
		elif l[i - 1] < l[i] < l[i + 1]:
			ans = max(ans, prefix[i - 1] + 1 + suffix[i + 1] + 1 + 1)
		elif l[i - 1] < l[i + 1]:
			ans = max(ans, prefix[i - 1] + 1 + suffix[i + 1] + 1)
		else:
			ans = max(ans, prefix[i - 1] + 1, suffix[i + 1] + 1)
	return ans
n = int(input())
l = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	if l[0] < l[1]:
		print(2)
	else:
		print(1)
else:
	prefix = fun(l, n)
	suffix = rev_fun(l, n)
	ans = generate(l, prefix, suffix)
	print(ans)


n = int(input())
array = list(map(int, input().split(' ')))
r = [1] * n
l = [1] * n
for i in range(n - 2, -1, -1):
	if array[i] < array[i + 1]:
		r[i] = r[i + 1] + 1
for i in range(1, n):
	if array[i] > array[i - 1]:
		l[i] = l[i - 1] + 1
size = max(r)
for i in range(1, n - 2):
	if array[i] < array[i + 2]:
		if size < l[i] + r[i + 2]:
			size = l[i] + r[i + 2]
print(size)


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

def increasing_subsquence_end(L):
	DP = [1 for i in L]
	for i in range(1, len(L)):
		if L[i] > L[i - 1]:
			DP[i] = DP[i - 1] + 1
	return DP

def increasing_subsquence_begin(L):
	DP = [1 for i in L]
	for i in range(len(L) - 2, -1, -1):
		if L[i] < L[i + 1]:
			DP[i] = DP[i + 1] + 1
	return DP
end = increasing_subsquence_end(s)
begin = increasing_subsquence_begin(s)
curr_max = max(end)
for i in range(1, len(s) - 1):
	curr_max = max(curr_max, end[i - 1] + begin[i + 1] if s[i - 1] < s[i + 1] else 0)
print(curr_max)


n = int(input())
aa = list(map(int, input().split()))
(ll, rr) = ([1] * n, [1] * n)
(cl, cr) = (1, 1)
res = 0
for (il, ir) in [(i, n - 1 - i) for i in range(1, n)]:
	cl = cl + 1 if aa[il - 1] < aa[il] else 1
	cr = cr + 1 if aa[ir] < aa[ir + 1] else 1
	res = max(res, cl)
	res = max(res, cr)
	(ll[il], rr[ir]) = (cl, cr)
for i in range(1, n - 1):
	if aa[i - 1] < aa[i + 1]:
		res = max(res, ll[i - 1] + rr[i + 1])
print(res)


input()
arr = list(map(int, input().split()))
m_arr = [(1, 1), (2 if arr[-2] < arr[-1] else 1, 1)]
for n in range(len(arr) - 3, -1, -1):
	t0 = m_arr[-1][0] + 1 if arr[n] < arr[n + 1] else 1
	t1 = m_arr[-2][0] + 1 if arr[n] < arr[n + 2] else 1
	m_arr.append((t0, t1))
idx = 0
while idx < len(m_arr):
	elem = m_arr[idx]
	if elem[1] > elem[0]:
		m_arr[idx] = (elem[1], elem[1])
		while idx + 1 < len(m_arr) and m_arr[idx + 1][0] > 1:
			idx += 1
			m_arr[idx] = (m_arr[idx - 1][0] + 1, 0)
	idx += 1
print(max(map(max, m_arr)))


n = int(input())
a = list(map(int, input().split()))
noskip = [1] * n
oneskip = [-1] + [1] * (n - 1)
for i in range(1, n):
	if a[i] > a[i - 1]:
		noskip[i] = noskip[i - 1] + 1
		oneskip[i] = max([oneskip[i], oneskip[i - 1] + 1])
	if i > 1 and a[i] > a[i - 2]:
		oneskip[i] = max(oneskip[i], noskip[i - 2] + 1)
print(max(oneskip + noskip))


n = int(input())
arr = [int(x) for x in input().split()]
us = [1] * n
kam = [1] * n
for i in range(1, len(arr)):
	if arr[i - 1] < arr[i]:
		us[i] += us[i - 1]
for i in range(len(arr) - 2, 0, -1):
	if arr[i] < arr[i + 1]:
		kam[i] += kam[i + 1]
ans = max(us)
for i in range(n - 2):
	if arr[i] < arr[i + 2]:
		ans = max(ans, us[i] + kam[i + 2])
print(ans)


def solve():
	n = int(input())
	a = list(map(int, input().split(' ')))
	(l, r) = ([1] * n, [1] * n)
	for (i, v) in enumerate(reversed(a)):
		if i > 0:
			l[i] = l[i - 1] + 1 if v < a[-i] else 1
	l = list(reversed(l))
	for (i, v) in enumerate(a):
		if i > 0:
			r[i] = r[i - 1] + 1 if v > a[i - 1] else 1
	ans = max(l)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(ans, l[i + 1] + r[i - 1])
	print(ans)
solve()


from sys import stdin
inp = lambda : stdin.readline().strip()
x = int(inp())
a = [int(x) for x in inp().split()]
l = [1] * x
r = [1] * x
ans = 1
for i in range(x - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] = r[i + 1] + 1
		ans = max(ans, r[i])
for i in range(1, x):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
		ans = max(ans, l[i])
for i in range(x - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, l[i] + r[i + 2])
print(ans)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
arr = iia()
dp = [[1, 1] for i in range(len(arr))]
res = 1
for i in range(1, len(arr)):
	if arr[i] > arr[i - 1]:
		dp[i][0] += dp[i - 1][0]
		dp[i][1] += dp[i - 1][1]
	if i > 2 and arr[i] > arr[i - 2]:
		dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
	res = max(res, dp[i][1], dp[i][0])
print(res)


n = int(input())
a = [int(x) for x in input().split()]
l = [1 for i in range(n)]
r = [1 for i in range(n)]
for i in range(1, n):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
for i in range(n - 2, 0, -1):
	if a[i] < a[i + 1]:
		r[i] = r[i + 1] + 1
maxi = -9999999999
p = max(max(l), max(r))
for i in range(n):
	if i == 0:
		maxi = max(maxi, r[i + 1])
	elif i == n - 1:
		maxi = max(maxi, l[i - 1])
	elif a[i - 1] >= a[i + 1]:
		maxi = max(maxi, max(l[i - 1], r[i + 1]))
	else:
		maxi = max(maxi, l[i - 1] + r[i + 1])
print(max(p, maxi))


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fun1(i, k):
	if i <= k:
		return i
	else:
		return k - (i - k)
n = int(input())
ar = [0] + list(map(int, input().split()))
dpI = [1] * (n + 5)
dpU = [1] * (n + 5)
answer = 1
for i in range(2, n + 1):
	if ar[i - 1] < ar[i]:
		dpI[i] += dpI[i - 1]
	answer = max(answer, dpI[i])
for i in range(n - 1, 0, -1):
	if ar[i + 1] > ar[i]:
		dpU[i] += dpU[i + 1]
for i in range(2, n):
	if ar[i - 1] < ar[i + 1]:
		temp = dpI[i - 1] + dpU[i + 1]
		answer = max(answer, temp)
print(answer)
sys.exit(0)

def gcs(a, b):
	n = len(a)
	m = len(b)
	f = [[0] * (n + 1) for i in range(m + 1)]
	for i in range(1, n):
		for j in range(1, m):
			if a[i] == b[j]:
				f[i][j] = f[i - 1][j - 1] + 1
			else:
				f[i][j] = max(f[i - 1][j], f[i][j - 1])
	(i, j, l) = (n - 1, m - 1, 0)
	answer = []
	while i != 0:
		if f[i][j] == f[i - 1][j] + 1 and f[i][j] == f[i][j - 1] + 1:
			print(i, j, l)
			answer.append(a[i])
			i -= 1
			l = j - 1
		j -= 1
		if j == 0:
			i -= 1
			j = l
	for i in range(0, n):
		for j in range(0, m):
			print(f[i][j], end=' ')
		print('\n', end='')
	print(answer)
	return f[n - 1][m - 1]
print(gcs('1baccbca', '2abcabaac'))
for t in range(int(input())):
	n = int(input())
	ar1 = [' '] + list(map(str, input().split()))
	ar2 = [' '] + list(map(str, input().split()))
	dp = [[0] * (n + 1) for i in range(n + 1)]
	for i in range(1, n + 1):
		for j in range(1, n + 1):
			dp[i][j] = dp[i - 1][j]
			if ar1[i] == ar2[j]:
				dp[i][j] = dp[i - 1][j - 1] + 1
			else:
				dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])


n = input()
s = input().split()
s = [int(x) for x in s]
maxis = [1]
maxirs = [-1]
maxit = 1
for i in range(1, len(s)):
	maxis.append(1)
	maxirs.append(-1)
	if s[i - 1] < s[i]:
		maxis[i] = maxis[i - 1] + 1
		if maxirs[i - 1] != -1:
			maxirs[i] = maxirs[i - 1] + 1
	if i > 1 and s[i - 2] < s[i]:
		maxirs[i] = max(maxis[i - 2] + 1, maxirs[i])
	if maxis[i] > maxit:
		maxit = maxis[i]
	if maxirs[i] > maxit:
		maxit = maxirs[i]
print(maxit)


from sys import exit

def iis():
	return map(int, input().split())

def ii():
	return int(input())

def liis():
	return list(map(int, input().split()))
n = ii()
a = liis()
fim = [0] * n
fim[0] = 1
tam = 1
for i in range(1, n):
	if a[i] <= a[i - 1]:
		tam = 1
		fim[i] = tam
	else:
		fim[i] = tam + 1
		tam += 1
cont = [0] * n
cont[n - 1] = 1
tam = 1
for i in range(n - 2, -1, -1):
	if a[i] >= a[i + 1]:
		tam = 1
		cont[i] = tam
	else:
		cont[i] = tam + 1
		tam += 1
ans = 0
for i in range(n):
	ans = max(ans, cont[i])
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, fim[i - 1] + cont[i + 1])
print(ans)


import sys, re, math
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest

def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def sortListWithIndex(listOfTuples, idx):
	return sorted(listOfTuples, key=lambda x: x[idx])

def sortDictWithVal(passedDic):
	temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))[::-1]
	toret = {}
	for tup in temp:
		toret[tup[0]] = tup[1]
	return toret

def sortDictWithKey(passedDic):
	return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
n = INT()
a = LIST()
l = [1] * n
r = [1] * n
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] = r[i + 1] + 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
ans = max(l)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
dpright = [1 for i in range(n)]
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dpright[i] = dpright[i + 1] + 1
dpleft = [1 for i in range(n)]
for i in range(1, n):
	if a[i] > a[i - 1]:
		dpleft[i] = dpleft[i - 1] + 1
m = max(dpright[0], dpright[1], dpleft[n - 2])
if a[0] < a[1]:
	m = max(m, 1 + dpright[1])
if a[-2] < a[-1]:
	m = max(m, 1 + dpleft[-2])
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		m = max(m, dpleft[i - 1] + dpright[i + 1])
	if a[i] < a[i + 1]:
		m = max(m, dpleft[i] + dpright[i + 1])
print(m)


n = int(input())
a = [int(i) for i in input().split()]
l = [0] * n
r = [0] * n
l[0] = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
	else:
		l[i] = 1
r[n - 1] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] = r[i + 1] + 1
	else:
		r[i] = 1
final = 0
s = 0
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		s = l[i - 1] + r[i + 1]
	if s > final:
		final = s
if final < max(l):
	final = max(l)
print(final)


n = int(input())
a = list(map(int, input().split()))
arr = [0] * n
arr[0] = 1
temp = [-1] * n
m = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		arr[i] += arr[i - 1] + 1
		m = max(m, arr[i])
	else:
		arr[i] = 1
if arr[n - 1] == 1:
	temp[n - 1] = n - 1
for i in range(n - 2, -1, -1):
	if arr[i] == 1:
		temp[i] = i
	else:
		temp[i] = temp[i + 1]
if m == n:
	print(m)
else:
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			p = n - 1
			if i + 2 < n:
				if temp[i + 2] != -1:
					p = temp[i + 2] - 1
			m = max(m, arr[i - 1] + (arr[p] - arr[i + 1] + 1))
	print(m)


from sys import stdin
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
n = int(input())
l = list(map(int, input().split()))
i = 0
maxi = 1
flag1 = 0
idx = []
for i in range(n - 1):
	if l[i] >= l[i + 1]:
		try:
			idx.append([i, i - idx[-1][0]])
		except:
			idx.append([i, i + 1])
cnt = 0
if idx == []:
	print(n)
	exit()
for i in range(n - 1):
	if l[i] >= l[i + 1]:
		z = i + 1
		(a, b) = idx[cnt]
		b -= 1
		if cnt + 1 < len(idx):
			c = idx[cnt + 1][1]
			if i - 1 >= 0 and l[i - 1] < l[i + 1]:
				maxi = max(b + c, maxi)
			else:
				maxi = max(maxi, b + 1, c)
			if i + 2 < n:
				b += 1
				c -= 1
				if l[i + 2] > l[i]:
					maxi = max(b + c, maxi)
		else:
			c = n - 1 - i
			if i - 1 >= 0 and l[i - 1] < l[i + 1]:
				maxi = max(b + c, maxi)
			else:
				maxi = max(maxi, b + 1, c)
			if i + 2 < n:
				b += 1
				c -= 1
				if l[i + 2] > l[i]:
					maxi = max(b + c, maxi)
		cnt += 1
print(maxi)


import sys
inf = int(1000000.0)
n = int(input())
lis = list(map(int, input().split()))
un = [1] * n
de = [1] * n
for i in range(1, n):
	if lis[i] > lis[i - 1]:
		un[i] = un[i - 1] + 1
		de[i] = de[i - 1] + 1
	if i >= 2 and lis[i] > lis[i - 2]:
		de[i] = max(de[i], un[i - 2] + 1)
ans1 = max(de)
ans2 = max(un)
print(max(ans1, ans2))


n = int(input())
a = [int(i) for i in input().split()]
b1 = [1] * n
b2 = [1] * n
for i in range(1, n):
	if a[i - 1] < a[i]:
		b1[i] = max(b1[i - 1] + 1, b1[i])
		b2[i] = max(b2[i - 1] + 1, b2[i])
	if i < n - 1 and a[i - 1] < a[i + 1]:
		b2[i + 1] = b1[i - 1] + 1
print(max(b2))


N = int(input())
A = list(map(int, input().split()))
increasing = [1] * N
for i in range(1, N):
	if A[i] > A[i - 1]:
		increasing[i] = increasing[i - 1] + 1
decreasing = [1] * N
for i in range(N - 2, -1, -1):
	if A[i] < A[i + 1]:
		decreasing[i] = decreasing[i + 1] + 1
afterRem = [1] * N
for i in range(N):
	try:
		l = increasing[i - 1]
		if i == 0:
			raise IndexError
	except IndexError:
		l = 0
	try:
		r = decreasing[i + 1]
	except IndexError:
		r = 0
	try:
		if i > 0 and A[i - 1] < A[i + 1]:
			afterRem[i] = l + r
		else:
			afterRem[i] = max(l, r)
	except IndexError:
		afterRem[i] = max(l, r)
print(max(max(increasing), max(afterRem)))


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


size = int(input())
nums = list(map(int, input().split()))
n = len(nums)
prefix = [1] * n
for i in range(1, n - 1):
	if nums[i] > nums[i - 1]:
		prefix[i] = prefix[i - 1] + 1
suffix = [1] * n
for i in range(n - 2, -1, -1):
	if nums[i] < nums[i + 1]:
		suffix[i] = suffix[i + 1] + 1
ans = max(max(prefix), max(suffix))
for i in range(1, n - 1):
	if nums[i - 1] < nums[i + 1]:
		ans = max(ans, prefix[i - 1] + suffix[i + 1])
print(ans)


from collections import defaultdict as dc
import sys
import math
mod = 10 ** 9 + 7

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p
n = inp()
a = line()
l = [1] * n
r = [1] * (n + 1)
ans = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		l[i] = l[i - 1] + 1
	else:
		l[i] = 1
	ans = max(ans, l[i])
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		r[i] = r[i + 1] + 1
	else:
		r[i] = 1
for i in range(1, n - 1, 1):
	if a[i + 1] > a[i - 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(max(ans, 1))


n = int(input())
numbs = [int(x) for x in input().split()]
pref = [1] * n
suf = [1] * n
ans = 1
for i in range(n - 2, -1, -1):
	if numbs[i + 1] > numbs[i]:
		suf[i] = suf[i + 1] + 1
	ans = max(suf[i], ans)
for i in range(1, n):
	if numbs[i - 1] < numbs[i]:
		pref[i] = pref[i - 1] + 1
	ans = max(ans, pref[i])
for i in range(1, n - 2):
	if numbs[i] < numbs[i + 2]:
		ans = max(ans, pref[i] + suf[i + 2])
print(ans)


n = int(input())
a = list(map(int, input().split()))
pf = [1] * n
sf = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		pf[i] = pf[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		sf[i] = sf[i + 1] + 1
if pf[-1] == n:
	print(n)
else:
	m = max(pf)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			m = max(m, pf[i - 1] + sf[i + 1])
		else:
			m = max(m, pf[i - 1], sf[i + 1])
	print(max(m, pf[-1], sf[0], sf[-1], pf[0]))


import os
import sys
from bisect import bisect_right
from fractions import Fraction

def main():
	n = int(input())
	a = list(map(int, input().split()))
	arr = a[::-1]
	lt = [1] * n
	rt = [1] * n
	for i in range(n - 1):
		if a[i] < a[i + 1]:
			lt[i + 1] = lt[i] + 1
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			rt[-i - 2] += rt[-i - 1]
	ans = max(lt)
	for i in range(n - 2):
		if a[i] < a[i + 2]:
			ans = max(ans, lt[i] + rt[i + 2])
	print(ans)
main()


n = int(input())
arr = list(map(int, input().split()))
count = 1
aL = [1] * n
bR = [1] * n
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		aL[i] += aL[i - 1]
		count = max(count, aL[i])
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		bR[i] += bR[i + 1]
		count = max(count, bR[i])
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		count = max(count, aL[i - 1] + bR[i + 1])
print(count)


n = int(input())
a = list(map(int, input().split())) + [0]
max_len = 0
lr = []
cnt = left = right = 0
for i in range(n - 1):
	if a[i] < a[i + 1]:
		right += 1
	else:
		lr.append([left, right])
		left = right = i + 1
lr.append([left, right])
for i in range(len(lr) - 1):
	if lr[i][1] - lr[i][0] + 1 > max_len:
		max_len = lr[i][1] - lr[i][0] + 1
	if a[lr[i][1]] < a[lr[i + 1][0] + 1] or a[lr[i][1] - 1] < a[lr[i + 1][0]]:
		ls = lr[i + 1][1] - lr[i][0]
		if ls > max_len:
			max_len = ls
if lr[-1][1] - lr[-1][0] + 1 > max_len:
	max_len = lr[-1][1] - lr[-1][0] + 1
print(max_len)


n = int(input())
a = list(map(int, input().split()))
b = [1] * n
tab = []
for i in range(n - 1):
	if a[i] < a[i + 1]:
		b[i + 1] = b[i] + 1
	else:
		b[i + 1] = 1
		tab.append((i - b[i] + 1, i, b[i]))
tab.append((n - b[-1], n - 1, b[-1]))
res = 0
for i in range(len(tab) - 1):
	res = max(res, tab[i][2])
	if min(tab[i][2], tab[i + 1][2]) > 1 and (a[tab[i][1]] < a[tab[i + 1][0] + 1] or a[tab[i][1] - 1] < a[tab[i + 1][0]]):
		res = max(res, tab[i][2] + tab[i + 1][2] - 1)
res = max(res, tab[-1][2])
for i in range(1, len(tab) - 1):
	if tab[i][2] == 1 and a[tab[i - 1][1]] < a[tab[i + 1][0]]:
		res = max(res, tab[i - 1][2] + tab[i + 1][2])
print(res)


n = int(input())
s = list(map(int, input().split()))
L = [1] * n
R = [1] * n
for i in range(n - 1):
	if s[i] < s[i + 1]:
		L[i + 1] += L[i]
for i in range(n - 1, 0, -1):
	if s[i] > s[i - 1]:
		R[i - 1] += R[i]
ans = max(L)
for i in range(n - 2):
	if s[i] < s[i + 2]:
		ans = max(ans, L[i] + R[i + 2])
print(ans)


from sys import stdin
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
dp1 = [0] * n
for i in range(n - 1, -1, -1):
	if i == n - 1:
		dp1[i] = 1
		continue
	if arr[i] < arr[i + 1]:
		dp1[i] = dp1[i + 1] + 1
	else:
		dp1[i] = 1
dp2 = [0] * n
for i in range(n):
	if i == 0:
		dp2[i] = 1
	if arr[i] > arr[i - 1]:
		dp2[i] = dp2[i - 1] + 1
	else:
		dp2[i] = 1
ans = 1
for i in range(len(arr)):
	if i == 0:
		pass
	elif i + 1 < n and arr[i - 1] < arr[i + 1]:
		ans = max(ans, dp2[i - 1] + dp1[i + 1])
	else:
		ans = max(ans, dp2[i])
print(ans)


n = int(input())
arr = list(map(int, input().split()))
start = [1] * n
end = [1] * n
for i in range(1, n):
	if arr[i - 1] < arr[i]:
		end[i] = end[i - 1] + 1
for i in range(n - 1, 0, -1):
	if arr[i - 1] < arr[i]:
		start[i - 1] = start[i] + 1
sol = max(end)
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		sol = max(sol, end[i - 1] + start[i + 1])
print(sol)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	a = li()
	inc = [1] * (n + 1)
	dec = [1] * (n + 1)
	for i in range(1, n):
		if a[i] > a[i - 1]:
			inc[i] += inc[i - 1]
		else:
			inc[i] = 1
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			dec[i] += dec[i + 1]
		else:
			dec[i] = 1
	mx = 0
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			mx = max(mx, inc[i - 1] + dec[i + 1])
	for i in range(n):
		mx = max(mx, inc[i])
	print(mx)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
arr = list(map(int, input().split()))
a = []
temp = [arr[0]]
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		temp.append(arr[i])
	else:
		a.append(temp)
		temp = [arr[i]]
a.append(temp)
c = 0
ans = []
for i in range(len(a) - 1):
	x = a[i]
	y = a[i + 1]
	m = 0
	n = 0
	if len(x) > 1:
		if y[0] > x[-2]:
			m = len(x) - 1 + len(y)
	if len(y) > 1:
		if y[1] > x[-1]:
			n = len(x) + len(y) - 1
	if m == 0 and n == 0:
		ans.append(len(x))
		ans.append(len(y))
	else:
		ans.append(max(m, n))
if ans:
	print(max(ans))
else:
	print(n)


n = int(input())
A = list(map(int, input().strip().split()))
L = [1] * len(A)
R = [1] * len(A)
Ans = [1] * len(A)
for i in range(1, len(A)):
	if A[i] > A[i - 1]:
		L[i] = L[i] + L[i - 1]
for i in range(len(A) - 1, 0, -1):
	if A[i - 1] < A[i]:
		R[i - 1] = R[i - 1] + R[i]
Ans[-1] = L[-1]
for i in range(1, len(A) - 1):
	if A[i - 1] < A[i + 1]:
		Ans[i] = max([L[i], L[i - 1] + R[i + 1]])
	else:
		Ans[i] = L[i]
print(max(Ans))


def solve(n, ar):
	r = [1] * n
	l = [1] * n
	ans = 0
	for i in range(n - 2, -1, -1):
		if ar[i] < ar[i + 1]:
			r[i] = r[i + 1] + 1
		ans = max(ans, r[i])
	for i in range(1, n):
		if ar[i] > ar[i - 1]:
			l[i] = l[i - 1] + 1
		ans = max(ans, l[i])
	for i in range(n - 2):
		if ar[i] < ar[i + 2]:
			ans = max(ans, l[i] + r[i + 2])
	print(ans)
n = int(input())
ar = list(map(int, input().split()))
solve(n, ar)


import sys, math
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math, itertools

def solve():
	N = getInt()
	A = getInts()
	if N == 1:
		return 1
	subsequences = []
	subs_right = []
	(ind, curr_len) = (0, 0)
	while ind < N:
		if ind == 0:
			curr_len += 1
			subsequences.append(curr_len)
			ind += 1
			continue
		if A[ind] <= A[ind - 1]:
			curr_len = 1
			subsequences.append(curr_len)
		else:
			curr_len += 1
			subsequences.append(curr_len)
		ind += 1
	(ind, curr_len) = (N - 1, 0)
	while ind > -1:
		if ind == N - 1:
			curr_len += 1
			subs_right.append(curr_len)
			ind -= 1
			continue
		if A[ind] >= A[ind + 1]:
			curr_len = 1
			subs_right.append(curr_len)
		else:
			curr_len += 1
			subs_right.append(curr_len)
		ind -= 1
	best = 0
	subs_right.reverse()
	if subsequences[N - 1] == N:
		return N
	for i in range(N):
		if i == 0:
			best = max(best, subs_right[i + 1])
			continue
		if i == N - 1:
			best = max(best, subsequences[i - 1])
			continue
		if A[i - 1] < A[i + 1]:
			best = max(best, subsequences[i - 1] + subs_right[i + 1])
		best = max(best, subsequences[i - 1], subs_right[i + 1])
	return best
print(solve())


n = int(input())
l = list(map(int, input().split()))
ll = []
dum = [0, l[0]]
i = 1
mxx = -1
while i < n:
	if l[i] > l[i - 1]:
		dum.append(l[i])
	else:
		dum.append(i - 1)
		ll.append(dum)
		mxx = max(mxx, len(dum) - 2)
		dum = [i, l[i]]
	i += 1
if len(dum) >= 2:
	dum.append(n - 1)
	ll.append(dum)
	mxx = max(mxx, len(dum) - 2)
mx = -1
for i in range(1, len(ll)):
	if ll[i - 1][-1] + 1 == ll[i][0] and len(ll[i]) > 3 and (len(ll[i - 1]) > 3):
		if ll[i - 1][-2] < ll[i][2]:
			if len(ll[i - 1]) + len(ll[i]) - 4 > mx:
				mx = len(ll[i - 1]) + len(ll[i]) - 4
		elif ll[i - 1][-3] < ll[i][1]:
			if len(ll[i - 1]) + len(ll[i]) - 4 > mx:
				mx = len(ll[i - 1]) + len(ll[i]) - 4
print(max(mxx, mx - 1))


n = int(input())
it = list(map(int, input().split()))
dp = [1 for i in range(n)]
for i in range(1, n):
	if it[i] > it[i - 1]:
		dp[i] = dp[i - 1] + 1
do = [1 for i in range(n)]
for i in range(n - 2, -1, -1):
	if it[i] < it[i + 1]:
		do[i] = do[i + 1] + 1
ma = max(dp)
for i in range(1, n - 1):
	if it[i + 1] > it[i - 1]:
		ma = max(ma, do[i + 1] + dp[i - 1])
print(ma)


from sys import stdin, stdout
n = stdin.readline()
n = int(n)
total = stdin.readline().split()
ar = []
for i in total:
	ar.append(int(i))
lt = [1] * n
rt = [1] * n
ans = int(0)
for i in range(1, n):
	if ar[i - 1] < ar[i]:
		lt[i] = lt[i - 1] + 1
	ans = max(ans, lt[i])
for i in range(n - 2, -1, -1):
	if ar[i] < ar[i + 1]:
		rt[i] = rt[i + 1] + 1
	ans = max(ans, rt[i])
for i in range(1, n - 1):
	if ar[i - 1] < ar[i + 1]:
		ans = max(ans, lt[i - 1] + rt[i + 1])
stdout.write(str(ans))


n = int(input())
A = list(map(int, input().split()))
I = [0 for _ in range(n)]
D = [0 for _ in range(n)]
for i in range(n):
	if i == 0:
		I[i] = 1
	elif A[i] > A[i - 1]:
		I[i] = I[i - 1] + 1
	else:
		I[i] = 1
for i in range(n - 1, -1, -1):
	if i == n - 1:
		D[i] = 1
	elif A[i] < A[i + 1]:
		D[i] = D[i + 1] + 1
	else:
		D[i] = 1
res = max(D)
for i in range(1, n - 1):
	if A[i - 1] < A[i + 1]:
		res = max(res, I[i - 1] + D[i + 1])
print(res)


n = int(input())
l = list(map(int, input().split()))
l1 = [1] * n
l2 = [1] * n
for i in range(1, n):
	if l[i] > l[i - 1]:
		l1[i] = l1[i - 1] + 1
for i in range(n - 2, -1, -1):
	if l[i + 1] > l[i]:
		l2[i] = l2[i + 1] + 1
ans = max(l1)
for i in range(n - 2):
	if l[i] < l[i + 2]:
		ans = max(ans, l1[i] + l2[i + 2])
print(ans)


n = int(input())
a = list(map(int, input().split()))
dp = [1 for i in range(n)]
dpStart = [1 for i in range(n)]
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[i] = dp[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dpStart[i] = dpStart[i + 1] + 1
m = max(dp)
ans = m
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, dp[i - 1] + dpStart[i + 1])
print(ans)


n = int(input())
arr = list(map(int, input().strip().split()))
maxi = 1
cont = 1
for i in range(n - 1):
	if arr[i] < arr[i + 1]:
		cont += 1
	else:
		maxi = max(cont, maxi)
		cont = 1
maxi = max(cont, maxi)
a_inc = [1 for i in range(n)]
a_dec = [1 for i in range(n)]
cont = 1
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		cont += 1
	else:
		cont = 1
	a_inc[i] = cont
cont = 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		cont += 1
	else:
		cont = 1
	a_dec[i] = cont
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		maxi = max(a_inc[i - 1] + a_dec[i + 1], maxi)
print(maxi)


from sys import stdin, stdout
outputs = []
n = int(stdin.readline().strip())
arr = [int(num) for num in stdin.readline().strip().split()]
req = []
(l, r) = (0, 0)
for i in range(n - 1):
	if arr[i] < arr[i + 1]:
		r += 1
	else:
		req.append([l, r])
		l = i + 1
		r = i + 1
if l == n - 1:
	req.append([n - 1, n - 1])
else:
	req.append([l, r])
res = 1
for i in range(len(req)):
	res = max(res, req[i][1] - req[i][0] + 1)
(prev1, next1) = (None, None)
(prev2, next2) = (None, None)
(tot1, tot2) = (0, 0)
for i in range(len(req)):
	(prev1, next1) = (req[i][0] - 1, req[i][0] + 1)
	(prev2, next2) = (req[i][1] - 1, req[i][1] + 1)
	(tot1, tot2) = (0, 0)
	if prev1 == -1 or next1 == n:
		pass
	elif arr[prev1] < arr[next1]:
		tot1 += req[i - 1][1] - req[i - 1][0] + 1
		if next1 > req[i][1]:
			tot1 += req[i + 1][1] - req[i + 1][0] + 1
		else:
			tot1 += req[i][1] - req[i][0]
		res = max(res, tot1)
	else:
		pass
	if prev2 == -1 or next2 == n:
		pass
	elif arr[prev2] < arr[next2]:
		tot2 += req[i + 1][1] - req[i + 1][0] + 1
		if prev2 < req[i][0]:
			tot2 += req[i - 1][1] - req[i - 1][0] + 1
		else:
			tot2 += req[i][1] - req[i][0]
		res = max(res, tot2)
	else:
		pass
print(res)


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	n = N()
	arr = list(RL())
	dp = [[1, 0] for _ in range(n + 1)]
	dp[0] = [0, 0]
	res = 0
	for i in range(1, len(arr)):
		if arr[i] > arr[i - 1]:
			dp[i + 1][0] = max(dp[i][0] + 1, dp[i + 1][0])
			dp[i + 1][1] = dp[i][1] + 1
		if i - 2 >= 0 and arr[i] > arr[i - 2]:
			dp[i + 1][1] = max(dp[i + 1][1], dp[i - 1][0] + 1)
		res = max(res, max(dp[i + 1]))
	print(res)
main()


n = int(input().strip())
A = list(map(int, input().strip().split()))
max_l = 0
fir_sub_max_l = 0
sec_sub_max_l = 1
last = A[0]
sec_last = -1000000000000000000000000000000000
remove_type = 'other'
for (i, a) in enumerate(A[1:]):
	if a > last:
		sec_sub_max_l += 1
		sec_last = last
		last = a
	elif a > sec_last or (i != n - 2 and A[i + 2] > last):
		max_l = max(max_l, fir_sub_max_l + sec_sub_max_l)
		fir_sub_max_l = sec_sub_max_l - 1
		sec_sub_max_l = 1
		sec_last = last
		last = a
	else:
		max_l = max(max_l, fir_sub_max_l + sec_sub_max_l)
		fir_sub_max_l = 0
		sec_sub_max_l = 1
		sec_last = last
		last = a
max_l = max(max_l, fir_sub_max_l + sec_sub_max_l)
print(max_l)


n = int(input())
lis = [-1] + list(map(int, input().split())) + [0]
ans = [0] + [1] * n + [1]
prev = 0
for i in range(1, n + 1):
	if lis[i - 1] < lis[i]:
		ans[i] += ans[i - 1]
k = max(ans)
prev = 0
d = 0
ind = 0
for i in range(1, n + 2):
	if ans[i] == 1:
		if lis[ind + 2] > lis[ind]:
			d = max(d, ans[i - 1] + prev)
		if lis[ind + 1] > lis[ind - 1]:
			d = max(d, prev + ans[i - 1])
		prev = ans[i - 1]
		ind = i - 1
d -= 1
print(max(k, d))


n = int(input())
a = list(map(int, input().split())) + [0]
seq = []
cur_start = 0
prev = 0
for (i, x) in enumerate(a):
	if prev < x:
		pass
	else:
		seq.append((cur_start, i))
		cur_start = i
	prev = x
best = max([r - l for (l, r) in seq])
for ((l1, r1), (l2, r2)) in zip(seq, seq[1:]):
	if a[l2 - 1] < a[l2 + 1]:
		best = max(best, r2 - l1 - 1)
	if a[l2 - 2] < a[l2]:
		best = max(best, r2 - l1 - 1)
print(best)


n = int(input())
f = input().split(' ')
a = [int(f[i]) for i in range(0, n)]
pred = [0] * n
suc = [0] * n
ans = 0
pred[0] = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		pred[i] = pred[i - 1] + 1
	else:
		pred[i] = 1
	ans = max(ans, pred[i])
suc[n - 1] = 1
i = n - 2
while i >= 0:
	if a[i + 1] > a[i]:
		suc[i] = suc[i + 1] + 1
	else:
		suc[i] = 1
	i -= 1
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, pred[i - 1] + suc[i + 1])
print(ans, end='')


n = int(input())
a = list(map(int, input().split()))
b = [0] * n
c = [0] * n
cnt = 1
b[0] = 1
for i in range(1, n):
	if a[i - 1] < a[i]:
		cnt += 1
		b[i] = cnt
	else:
		cnt = 1
		b[i] = cnt
cnt = 1
c[n - 1] = 1
for i in range(0, n - 1)[::-1]:
	if a[i] < a[i + 1]:
		cnt += 1
		c[i] = cnt
	else:
		cnt = 1
		c[i] = cnt
ans = max(b)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, b[i - 1] + c[i + 1])
print(ans)


from sys import stdin, stdout
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
dp = [0 for i in range(n)]
dp[0] = 1
for i in range(1, n):
	if s[i] > s[i - 1]:
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = 1
aux = [0 for i in range(n)]
aux[-1] = dp[-1]
for i in range(n - 2, -1, -1):
	if dp[i + 1] != 1:
		aux[i] = aux[i + 1]
	else:
		aux[i] = dp[i]
ans = max(dp)
for i in range(1, n - 1):
	if s[i - 1] < s[i + 1]:
		ans = max(ans, dp[i - 1] + aux[i + 1] - dp[i + 1] + 1)
print(ans)


n = int(input())
a = [int(i) for i in input().split()]
ind = [0] * n
temp = []
cnt = 0
count = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		count += 1
		ind[i] = cnt
	else:
		temp.append(count)
		count = 1
		cnt += 1
		ind[i] = cnt
temp.append(count)
maxi = max(temp)
for i in range(1, n - 2):
	if ind[i] != ind[i + 1]:
		if a[i - 1] < a[i + 1]:
			curr = temp[ind[i]] + temp[ind[i + 1]] - 1
			maxi = max(curr, maxi)
		elif a[i] < a[i + 2]:
			curr = temp[ind[i]] + temp[ind[i + 1]] - 1
			maxi = max(curr, maxi)
print(maxi)


n = int(input())
arr = [int(x) for x in input().split()]
asc = [1]
for (a1, a2) in zip(arr, arr[1:]):
	if a1 < a2:
		asc.append(asc[-1] + 1)
	else:
		asc.append(1)
des = [1]
for (a1, a2) in zip(arr[:-1][::-1], arr[1:][::-1]):
	if a1 < a2:
		des.append(des[-1] + 1)
	else:
		des.append(1)
des = des[::-1]
max_len = [1] * n
for i in range(n):
	if i == 0:
		max_len[i] = asc[i + 1]
	elif i == n - 1:
		max_len[i] = des[i - 1]
	elif arr[i + 1] > arr[i - 1]:
		max_len[i] = asc[i - 1] + des[i + 1]
print(max(max_len + asc))


n = int(input())
a = [int(x) for x in input().split()]
ac = [1]
for (a1, a2) in zip(a, a[1:]):
	if a1 < a2:
		ac.append(ac[-1] + 1)
	else:
		ac.append(1)
ds = [1]
for (a1, a2) in zip(a[:-1][::-1], a[1:][::-1]):
	if a1 < a2:
		ds.append(ds[-1] + 1)
	else:
		ds.append(1)
ds = ds[::-1]
mx = [1] * n
for i in range(n):
	if i == 0:
		mx[i] = ds[i - 1]
	elif i == n - 1:
		mx[i] = ds[i - 1]
	elif a[i + 1] > a[i - 1]:
		mx[i] = ac[i - 1] + ds[i + 1]
print(max(mx + ac))


import sys, math, itertools, heapq, collections, bisect, string
input = lambda : sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
mod = 10 ** 9 + 7
ans = 0
count = 0
pro = 1
n = int(input())
A = list(map(int, input().split()))
L = [0] * n
R = [0] * n
for i in range(n - 1):
	count += 1
	L[i] = count
	if A[i] >= A[i + 1]:
		count = 0
L[n - 1] = count + 1
count = 0
for i in range(n - 1, 0, -1):
	count += 1
	R[i] = count
	if A[i - 1] >= A[i]:
		count = 0
R[0] = count + 1
if L[n - 1] == R[0] == n:
	print(n)
	exit()
for i in range(1, n - 1):
	if A[i - 1] < A[i + 1]:
		ans = max(ans, L[i - 1] + R[i + 1])
	else:
		ans = max(ans, L[i - 1], R[i + 1])
ans = max(ans, R[1])
ans = max(ans, L[n - 2])
print(ans)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
from heapq import heapify, heappop, heappush, heapreplace, heappushpop

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
res = ['YES', 'NO']
test_case = 1
while test_case:
	test_case -= 1
	n = ii()
	a = li()
	s = [1] * n
	res = []
	ind = []
	x = 0
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			x = 0
		else:
			x += 1
		s[i] += x
		if s[i] == 1:
			res.append(s[i - 1])
			ind.append(i)
	res.append(s[-1])
	ans = max(res)
	for i in range(len(ind)):
		x = ind[i]
		if x > 1 and a[x] > a[x - 2] or (x < n - 1 and a[x + 1] > a[x - 1]):
			ans = max(ans, res[i] + res[i + 1] - 1)
	print(ans)


def main():
	n = int(input())
	a = list(map(int, input().split()))
	l = [1] * n
	r = [1] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			l[i] += l[i - 1]
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			r[i] += r[i + 1]
	mx = max(r)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			mx = max(l[i - 1] + r[i + 1], mx)
	print(mx)
main()


n = int(input())
a = [0] + list(map(int, input().split())) + [10 ** 10]
f = [0] * (n + 2)
t = [0] * (n + 2)
for i in range(1, n + 1):
	if a[i] > a[i - 1]:
		f[i] = f[i - 1] + 1
	else:
		f[i] = 1
for i in range(n, 0, -1):
	if a[i] < a[i + 1]:
		t[i] = t[i + 1] + 1
	else:
		t[i] = 1
res = max(f)
for i in range(1, n + 1):
	if a[i - 1] < a[i + 1]:
		res = max(res, f[i - 1] + t[i + 1])
print(res)


n = int(input())
a = list(map(int, input().split()))
segs = [[a[0]]]
for i in range(1, n):
	if segs[-1][-1] < a[i]:
		segs[-1].append(a[i])
	else:
		segs.append([a[i]])
ret = len(segs[0])
for i in range(1, len(segs)):
	(prev, cur) = (segs[i - 1], segs[i])
	ret = max(ret, len(cur))
	if len(cur) > 1 and prev[-1] < cur[1] or (len(prev) > 1 and prev[-2] < cur[0]):
		ret = max(ret, len(cur) + len(prev) - 1)
print(ret)


N = int(input())
a = list(map(int, input().split()))
dp_l = [0] * N
dp_r = [0] * N
for i in range(N):
	if a[i] > a[i - 1]:
		dp_l[i] = dp_l[i - 1] + 1
	else:
		dp_l[i] = 1
dp_r[-1] = 1
for i in range(N - 2, -1, -1):
	if a[i] < a[i + 1]:
		dp_r[i] = dp_r[i + 1] + 1
	else:
		dp_r[i] = 1
if dp_l[-1] == N:
	print(N)
	exit()
ans = max(dp_l[-2], dp_r[1])
for i in range(1, N - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, dp_l[i - 1] + dp_r[i + 1])
	else:
		ans = max(ans, dp_l[i - 1], dp_r[i + 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
(l, r) = ([1], [1])
for i in range(1, n):
	if a[i] > a[i - 1]:
		l.append(l[-1] + 1)
	else:
		l.append(1)
	if a[n - i - 1] < a[n - i]:
		r.append(r[-1] + 1)
	else:
		r.append(1)
r = r[::-1]
ans = max(l)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


import random

def main():
	n = int(input())
	a = [int(number) for number in input().split()]
	seq = [1 for i in range(n)]
	max_seq = 1
	for i in range(1, n):
		if a[i] > a[i - 1]:
			seq[i] = seq[i - 1] + 1
	index = n - 1
	while index > 0:
		last_disrupt = index - seq[index]
		if last_disrupt > 0 and a[last_disrupt] != a[index]:
			if a[last_disrupt - 1] >= a[last_disrupt + 1] and last_disrupt < n - 2:
				if a[last_disrupt] < a[last_disrupt + 2]:
					if seq[last_disrupt] + seq[index] - 1 > max_seq:
						max_seq = seq[last_disrupt] + seq[index] - 1
			elif a[last_disrupt - 1] < a[last_disrupt + 1]:
				if seq[last_disrupt - 1] + seq[index] > max_seq:
					max_seq = seq[last_disrupt - 1] + seq[index]
		if seq[index] > max_seq:
			max_seq = seq[index]
		index = last_disrupt
	print(max_seq)
main()


def remove(n, a):
	i = 0
	l = []
	maxx = 0
	while i < n:
		st = i
		end = i + 1
		while end < n and a[end - 1] < a[end]:
			end += 1
		l.append((st, end - 1))
		diff = end - st
		if diff > maxx:
			maxx = diff
		i = end
	i = 1
	while i < len(l):
		summ = 0
		if i != len(l) - 1 and l[i][0] == l[i][1]:
			if a[l[i + 1][0]] > a[l[i - 1][1]]:
				summ = l[i - 1][1] - l[i - 1][0] + 1 + l[i + 1][1] - l[i + 1][0] + 1
			i += 1
		elif a[l[i][0]] > a[l[i - 1][1] - 1] or (l[i][0] != l[i][1] and a[l[i][0] + 1] > a[l[i - 1][1]]):
			summ = l[i - 1][1] - l[i - 1][0] + l[i][1] - l[i][0] + 1
		if summ > maxx:
			maxx = summ
		i += 1
	return maxx
n = int(input())
a = [int(i) for i in input().split()]
print(remove(n, a))


def numbersListInput():
	aux = list(map(int, input().strip().split()))
	return aux
n = int(input())
a = numbersListInput()
auxA = [1] * n
auxB = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		auxA[i] = auxA[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		auxB[i] = auxB[i + 1] + 1
res = max(auxA)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		res = max(res, auxA[i - 1] + auxB[i + 1])
print(res)


n = int(input())
arr = list(map(int, input().split()))
index = -1
temp = 1
lis = []
ind = []
for i in range(n - 1):
	if arr[i + 1] > arr[i]:
		temp += 1
	else:
		lis.append(temp)
		ind.append(i)
		temp = 1
		index = i
if index != n - 2:
	lis.append(temp)
l = len(ind)
p = len(lis)
for j in range(l):
	if ind[j] > 0 and arr[ind[j] - 1] < arr[ind[j] + 1] and (j < p - 1):
		lis.append(lis[j] + lis[j + 1] - 1)
for j in range(l):
	if ind[j] < n - 2 and arr[ind[j]] < arr[ind[j] + 2] and (j < p - 1):
		lis.append(lis[j] + lis[j + 1] - 1)
print(max(lis))


n = int(input())
l = [int(s) for s in input().split()]
val = [1] * n
val1 = [1] * n
if n == 1:
	print(1)
else:
	for i in range(1, n):
		if l[i - 1] < l[i]:
			val[i] = val[i - 1] + 1
		else:
			val[i] = 1
	for i in range(n - 2, -1, -1):
		if l[i] < l[i + 1]:
			val1[i] = val1[i + 1] + 1
		else:
			val1[i] = 1
	ans = max(max(val), max(val1[1:]), max(val1[:-1]))
	for i in range(1, n - 1):
		if l[i - 1] < l[i + 1]:
			ans = max(ans, val1[i + 1] + val[i - 1])
	print(ans)


n = int(input())
a = [int(x) for x in input().split()]
(c, b, x, d) = (1, 0, 0, 0)
(e, f, g, y) = (0, 0, 0, 0)
for i in range(1, n):
	if a[i - 1] < a[i]:
		c = c + 1
	else:
		x = max(x, b + c - d)
		if a[i - 2] >= a[i]:
			(b, d) = (0, 0)
		else:
			(d, b) = (1, c)
		c = 1
i = 0
x = max(x, b + c - d)
for i in range(0, n - 1):
	if a[i] < a[i + 1]:
		e = e + 1
	else:
		y = max(y, e + f + 1 - g)
		if i + 2 >= n:
			(e, f, g) = (-1, -1, 1)
		elif a[i] < a[i + 2]:
			g = 1
			f = e + 1
		else:
			g = 0
			f = 0
		e = 0
y = max(y, e + f + 1 - g)
print(max(x, y))


n = int(input())
a = list(map(int, input().split()))
c = [1] * (n + 1)
c2 = [1] * (n + 1)
for i in range(1, n):
	if a[i] > a[i - 1]:
		c[i] = c[i - 1] + 1
		c2[i] = c2[i - 1] + 1
	if i >= 2 and a[i] > a[i - 2]:
		c2[i] = max(c2[i], c[i - 2] + 1)
print(max(c2))


n = int(input())
l = list(map(int, input().split()))
ll = [1]
for i in range(1, n):
	if l[i] > l[i - 1]:
		ll[-1] += 1
	else:
		ll.append(1)
t = 0
ans = max(ll)
for i in range(len(ll) - 1):
	t += ll[i]
	if ll[i] != 1:
		end = t - 1
		bb = l[end - 1]
		kk = l[end + 1]
		if bb < kk:
			ans = max(ans, ll[i] + ll[i + 1] - 1)
	if ll[i + 1] != 1:
		end = t
		bb = l[end - 1]
		kk = l[end + 1]
		if bb < kk:
			ans = max(ans, ll[i] + ll[i + 1] - 1)
print(ans)


from os import path
import sys
from math import ceil, floor, gcd, log
from collections import defaultdict, Counter
maxx = float('inf')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
else:
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
n = I()
ls = lint()
(r, l) = ([1] * n, [1] * n)
for i in range(n - 2, -1, -1):
	if ls[i] < ls[i + 1]:
		r[i] = r[i + 1] + 1
for i in range(1, n):
	if ls[i] > ls[i - 1]:
		l[i] = l[i - 1] + 1
ans = max(l)
for i in range(1, n - 1):
	if ls[i - 1] < ls[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


class X:

	def __init__(self, d):
		self.start = d
		self.end = d
		self.before_end = d
		self.after_start = d
		self.size = 1

	def add(self, d):
		self.before_end = self.end
		if self.after_start == self.start:
			self.after_start = d
		self.end = d
		self.size += 1

def compare(a, b):
	res = [a.size, b.size]
	if a.before_end < b.start or a.end < b.after_start:
		res.append(a.size + b.size - 1)
	return max(res)
n = int(input())
arr = [int(x) for x in input().split()]
l = [X(arr[0])]
l_index = 0
for i in range(1, n):
	if arr[i] > l[l_index].end:
		l[l_index].add(arr[i])
	else:
		l_index += 1
		l.append(X(arr[i]))
res = l[0].size
for i in range(len(l) - 1):
	res = max(res, compare(l[i], l[i + 1]))
print(res)


import sys

def main():
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	left = [1] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			left[i] = left[i - 1] + 1
	right = [1] * n
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			right[i] = right[i + 1] + 1
	ans = max(left)
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(ans, left[i - 1] + right[i + 1])
	print(ans)
main()


n = int(input())
arr = [int(x) for x in input().split()]
if n is 2:
	print(2 if arr[1] > arr[0] else 1)
	exit()
l = [0] * (n + 1)
r = [0] * (n + 1)
l[0] = 1
r[n - 1] = 1
for i in range(1, n):
	l[i] = l[i - 1] + 1 if arr[i] > arr[i - 1] else 1
for i in range(n - 2, -1, -1):
	r[i] = r[i + 1] + 1 if arr[i] < arr[i + 1] else 1
ans = max(max(l), max(r))
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


n = int(input())
arr = [int(x) for x in input().split()]
pre = [0] * n
pos = [0] * n
pre[0] = 1
pos[n - 1] = 1
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		pre[i] = pre[i - 1] + 1
	else:
		pre[i] = 1
for i in range(n - 2, -1, -1):
	if arr[i + 1] > arr[i]:
		pos[i] = pos[i + 1] + 1
	else:
		pos[i] = 1
l = 1
ans = 0
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		l += 1
	else:
		l = 1
	ans = max(ans, l)
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(pre[i - 1] + pos[i + 1], ans)
print(ans)


from os import path
import sys, time
mod = int(1000000000.0 + 7)
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, permutations
from string import ascii_lowercase, ascii_uppercase
from bisect import *
from functools import reduce
from operator import mul
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().strip('\n')
grid = lambda r: [lint() for i in range(r)]
localsys = 0
start_time = time.time()
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)

def ceill(n, x):
	return (n + x - 1) // x
T = 0

def solve():
	n = I()
	a = lint()
	(l, r, ans) = ([1] * n, [1] * n, 1)
	for i in range(1, n):
		if a[i] > a[i - 1]:
			l[i] = l[i - 1] + 1
		ans = max(ans, l[i])
	for i in range(n - 2, -1, -1):
		if a[i + 1] > a[i]:
			r[i] = r[i + 1] + 1
		ans = max(ans, r[i])
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(ans, l[i - 1] + r[i + 1])
	print(ans)

def run():
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
run()
T = I() if T else 1
for _ in range(T):
	solve()
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


import math, collections, sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
r = [1 for i in range(n)]
l = [1 for i in range(n)]
for i in range(1, n):
	if a[i - 1] < a[i]:
		l[i] = l[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		r[i] = r[i + 1] + 1
ans = max(max(l), max(r))
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, r[i + 1] + l[i - 1])
print(ans)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from collections import defaultdict as dd
(n,) = I()
a = I()
ans = 0
inc = [1] * n
dec = [1] * n
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		inc[i] = 1 + inc[i + 1]
for i in range(1, n):
	if a[i] > a[i - 1]:
		dec[i] = 1 + dec[i - 1]
ans = max(dec)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, dec[i - 1] + inc[i + 1])
print(ans)


d0 = [0] * 200010
d1 = [0] * 200010
d2 = [0] * 200010
n = int(input())
v = list(map(int, input().split()))
d0[0] = 1
d1[0] = 0
d2[0] = 1
ans = 1
for i in range(1, n):
	d0[i] = 1
	if v[i] > v[i - 1]:
		d0[i] = d0[i - 1] + 1
		d2[i] = d2[i - 1] + 1
	d1[i] = d0[i - 1]
	if i > 1 and v[i] > v[i - 2]:
		d2[i] = max(d2[i], d1[i - 1] + 1)
	ans = max(ans, max(max(d0[i], d1[i]), d2[i]))
print(str(ans))


n = int(input())
a = list(map(int, input().split()))
m = 1
k = 0
e = 0
for i in range(n - 1):
	k = e
	c = 1
	while k < n - 1 and a[k] < a[k + 1]:
		c += 1
		k += 1
	e = k + 1
	k += 1
	if k < n and k - 2 >= 0 and (a[k] <= a[k - 2]):
		k += 1
	if k < n and k - 2 >= 0 and (a[k] > a[k - 2]):
		if k - 1 < n and k - 2 >= 0 and (a[k - 1] < a[k - 2]):
			c += 1
		while k < n - 1 and a[k] < a[k + 1]:
			c += 1
			k += 1
	if c > m:
		m = c
print(m)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
a = zzz()
l = [1] * n
r = [1] * n
j = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] = r[i + 1] + 1
	if a[j - 1] < a[j]:
		l[j] = l[j - 1] + 1
	j += 1
m = max(l)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		m = max(m, l[i - 1] + r[i + 1])
print(m)


n = int(input())
A = [int(x) for x in input().split()]
B = [0] * n
k = 0
K = [1]
for i in range(1, n):
	if A[i - 1] >= A[i]:
		k += 1
		K.append(0)
	K[k] += 1
	B[i] = k
m = max(K)
if n > 2:
	for i in range(1, n - 1):
		mm = K[B[i - 1]] + K[B[i + 1]]
		if K[B[i]] == 1:
			if A[i - 1] < A[i + 1]:
				mm = K[B[i - 1]] + K[B[i + 1]]
				m = max(mm, m)
		elif B[i - 1] < B[i + 1] and A[i - 1] < A[i + 1]:
			m = max(mm - 1, m)
print(m)


n = int(input())
arr = list(map(int, input().split()))
if n is 2:
	print(2 if arr[1] > arr[0] else 1)
	exit()
l = [0] * (n + 1)
r = [0] * (n + 1)
l[0] = 1
r[n - 1] = 1
for i in range(1, n):
	l[i] = l[i - 1] + 1 if arr[i] > arr[i - 1] else 1
for i in range(n - 2, -1, -1):
	r[i] = r[i + 1] + 1 if arr[i] < arr[i + 1] else 1
mx = max(max(l), max(r))
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		mx = max(mx, l[i - 1] + r[i + 1])
print(mx)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		a = LI()
		t = [[a[0]]]
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				t.append([])
			t[-1].append(a[i])
		t.append([-1])
		tl = len(t)
		r = 0
		for i in range(tl - 1):
			u = len(t[i])
			if len(t[i]) > 1 and t[i][-2] < t[i + 1][0]:
				u = len(t[i]) + len(t[i + 1]) - 1
			if len(t[i + 1]) > 1 and t[i][-1] < t[i + 1][1]:
				u = max(u, len(t[i]) + len(t[i + 1]) - 1)
			if r < u:
				r = u
		rr.append(r)
	return JA(rr, '\n')
print(main())


def seq_len(arr, n):
	seqs = []
	seq_b = 0
	seq_e = 0
	longest = -1
	for i in range(0, n - 1):
		if arr[i + 1] > arr[i]:
			seq_e = i + 1
		else:
			longest = max(longest, seq_e - seq_b + 1)
			seqs.append((seq_b, seq_e))
			seq_b = i + 1
			seq_e = i + 1
	longest = max(longest, seq_e - seq_b + 1)
	seqs.append((seq_b, seq_e))
	if len(seqs) > 1:
		for i in range(0, len(seqs) - 1):
			if seqs[i][1] - 1 >= 0:
				if arr[seqs[i][1] - 1] < arr[seqs[i + 1][0]]:
					longest = max(longest, seqs[i][1] - seqs[i][0] + 1 + seqs[i + 1][1] - seqs[i + 1][0])
			if seqs[i + 1][0] + 1 < n:
				if arr[seqs[i][1]] < arr[seqs[i + 1][0] + 1]:
					longest = max(longest, seqs[i][1] - seqs[i][0] + 1 + seqs[i + 1][1] - seqs[i + 1][0])
		return longest
	else:
		return n
n = int(input())
arr = [int(x) for x in input().split()]
print(seq_len(arr, n))


from collections import deque
n = int(input())
arr = [10 ** 9 + 1] + list(map(int, input().split(' '))) + [0]
last = [0, 0]
j = 0
maxi = 0
for i in range(n + 1):
	if arr[i] >= arr[i + 1]:
		if last and last[1] == j - 1 and (arr[last[1] - 1] < arr[j] or arr[last[1]] < arr[j + 1]):
			maxi = max(maxi, i - last[0])
		else:
			maxi = max(maxi, i - j + 1)
		last = [j, i]
		j = i + 1
maxi = max(maxi, last[1] - last[0] + 1)
print(maxi)


import sys, bisect
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
n = inp()
nums = inlt()
val = [0 for i in range(n)]
cnt = 1
val[0] = 1
for i in range(1, n):
	if nums[i - 1] >= nums[i]:
		for j in range(i - 1, i - cnt - 1, -1):
			val[j] = cnt
		cnt = 1
	else:
		cnt += 1
	val[i] = cnt
for j in range(n - 1, n - cnt - 1, -1):
	val[j] = cnt
ans = 0
for i in range(1, n - 1):
	if nums[i + 1] <= nums[i] and nums[i + 1] > nums[i - 1]:
		ans = max(ans, val[i] - 1 + val[i + 1])
	elif nums[i - 1] >= nums[i] and nums[i + 1] > nums[i - 1]:
		ans = max(ans, val[i] - 1 + val[i - 1])
print(max(ans, max(val)))


n = int(input())
arr = list(map(int, input().split()))
l = [1] * len(arr)
r = [1] * len(arr)
length = len(arr)
for i in range(1, length):
	if arr[i - 1] < arr[i]:
		l[i] = l[i - 1] + 1
	if arr[length - i] > arr[length - i - 1]:
		r[length - i - 1] = r[length - i] + 1
max1 = max(l)
for i in range(1, length - 1):
	if arr[i - 1] < arr[i + 1]:
		max1 = max(max1, l[i - 1] + r[i + 1])
print(max1)


n = int(input())
A = [int(i) for i in input().split()]
if n == 1:
	print(1)
elif n == 2:
	if A[1] > A[0]:
		print(2)
	else:
		print(1)
else:
	left = [1] * n
	right = [1] * n
	for i in range(1, n):
		if A[i] > A[i - 1]:
			right[i] = 1 + right[i - 1]
		else:
			right[i] = 1
	for i in range(n - 2, -1, -1):
		if A[i] < A[i + 1]:
			left[i] = 1 + left[i + 1]
		else:
			left[i] = 1
	maxi = max(max(left), max(right))
	for i in range(1, n - 1):
		if A[i - 1] < A[i + 1]:
			maxi = max(maxi, left[i + 1] + right[i - 1])
	print(maxi)


n = int(input()) + 1
a = [10 ** 18] + list(map(int, input().split())) + [-1, -1]
stack = []
length = 1
for (i, x, y) in zip(range(2, n + 1), a[1:], a[2:]):
	if x >= y:
		stack.append((length, i))
		length = 1
	else:
		length += 1
stack.append((0, n))
ans = 0
for ((x, i), (y, _)) in zip(stack, stack[1:]):
	if a[i - 1] < a[i + 1] or a[i - 2] < a[i]:
		ans = max(ans, x + y - 1)
	else:
		ans = max(ans, x)
print(ans)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
n = int(cin())
a = list(map(int, cin().split()))
length = i = 1
k = 0
x = [1]
while i < n:
	j = i
	while j < n:
		if a[j] > a[j - 1]:
			j += 1
			x.append(j - i + 1)
		else:
			x.append(1)
			break
	i = j + 1
x.append(1)
length = max(x)
lst = []
for i in range(1, n + 1):
	if x[i] == 1:
		lst.append(i)
for i in range(len(lst) - 1):
	if lst[i] >= n - 1:
		break
	if a[lst[i] + 1] > a[lst[i] - 1]:
		length = max(length, x[lst[i + 1] - 1] + x[lst[i] - 1] - 1)
	if lst[i] - 2 >= 0 and a[lst[i]] > a[lst[i] - 2]:
		length = max(length, x[lst[i + 1] - 1] + x[lst[i] - 2])
cout(str(length))


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n = int(input())
a = [int(x) for x in input().split()]
ans = 1
r = [1 for _ in range(n)]
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		r[i] = r[i + 1] + 1
	ans = max(ans, r[i])
l = [1 for _ in range(n)]
for i in range(1, n):
	if a[i - 1] < a[i]:
		l[i] = l[i - 1] + 1
	ans = max(ans, l[i])
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, l[i] + r[i + 2])
print(ans)


n = int(input())
v = list(map(int, input().split()))
a = [0] * (n + 1)
a[0] = 1
for i in range(1, n):
	if v[i] <= v[i - 1]:
		a[i] = 1
	else:
		a[i] = a[i - 1] + 1
ans = [1]
i = 1
while i < n - 1:
	if a[i] == 1:
		if v[i - 1] < v[i + 1]:
			j = a[i - 1]
			k = i + 1
			while a[k] > 1:
				j = j + 1
				i = k
				k = k + 1
				if k == n:
					break
			ans.append(j)
		elif i > 1:
			if v[i - 2] < v[i]:
				j = a[i - 2] + 1
				k = i
				if k < n - 1:
					while v[k] < v[k + 1]:
						j = j + 1
						i = k
						k = k + 1
						if k >= n - 1:
							break
				ans.append(j)
	i = i + 1
	if i >= n:
		break
f = [max(ans), max(a)]
print(max(f))


n = int(input())
arr = list(map(int, input().split()))
inc = []
count = 1
start = 0
if len(arr) == 1:
	print(1)
else:
	for i in range(1, len(arr)):
		if arr[i] > arr[i - 1]:
			count += 1
		else:
			if i - start != 1:
				inc.append([start, i - 1, i - start])
			start = i
			count = 0
	if i - start + 1 > 1:
		inc.append([start, i, i - start + 1])
	if inc:
		m = inc[0][2]
	else:
		m = 1
	for i in range(1, len(inc)):
		if inc[i][0] - inc[i - 1][1] - 1 == 1:
			if arr[inc[i][0]] > arr[inc[i - 1][1]]:
				m = max(m, inc[i][2] + inc[i - 1][2])
		elif inc[i][0] - inc[i - 1][1] - 1 == 0:
			if arr[inc[i][0]] > arr[inc[i - 1][1] - 1]:
				m = max(m, inc[i][2] + inc[i - 1][2] - 1)
			elif arr[inc[i][0] + 1] > arr[inc[i - 1][1]]:
				m = max(m, inc[i][2] + inc[i - 1][2] - 1)
		m = max(m, inc[i][2])
	print(m)


n = int(input())
a = list(map(int, input().split()))
r = [1] * n
l = [1] * n
c = 1
d = 1
for i in range(1, n):
	if a[n - i] > a[n - i - 1]:
		c += 1
	else:
		c = 1
	r[n - i - 1] = c
	if a[i] > a[i - 1]:
		d += 1
	else:
		d = 1
	l[i] = d
maxC = max(l)
for i in range(1, n - 1):
	if a[i + 1] > a[i - 1]:
		maxC = max(maxC, l[i - 1] + r[i + 1])
print(maxC)


import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def rec(a, b, i):
	if a == b:
		return 0
	return min(rec(a + i, b, i + 1), rec(a, b + i, i + 1))

def solve():
	n = int(inp())
	a = lis()
	r = [1] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			r[i] = r[i - 1] + 1
	l = [1] * n
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			l[i] = l[i + 1] + 1
	ans = 0
	for i in range(0, n):
		ans = max(ans, r[i], l[i])
		if i == 0:
			ans = max(ans, l[i])
		elif i == n - 1:
			ans = max(ans, r[i])
		elif a[i - 1] < a[i + 1]:
			ans = max(ans, r[i - 1] + l[i + 1])
	print(ans)
testcase(1)


from sys import stdin, stdout
from collections import Counter
for _ in range(1):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	frwrd = [1] * n
	ans = 0
	back = [1] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			frwrd[i] = frwrd[i - 1] + 1
	for i in range(n - 2, -1, -1):
		if a[i] < a[i + 1]:
			back[i] = back[i + 1] + 1
	for i in range(1, n - 1):
		if a[i - 1] < a[i + 1]:
			ans = max(ans, frwrd[i - 1] + back[i + 1])
	ans = max(ans, max(frwrd))
	print(ans)


import sys, itertools, math
n = int(sys.stdin.readline())
N = [int(i) for i in sys.stdin.readline().strip().split(' ')]
L = [1] * n
R = [1] * n
ans = 1
for i in range(n - 2, -1, -1):
	if N[i + 1] > N[i]:
		R[i] = R[i + 1] + 1
for i in range(1, n):
	if N[i] > N[i - 1]:
		L[i] = L[i - 1] + 1
ans = max(max(R), max(L))
for i in range(0, n - 2):
	if N[i] < N[i + 2]:
		ans = max(ans, L[i] + R[i + 2])
print(ans)


n = int(input())
a = list(map(int, input().split()))
i = 0
b = []
while i < n:
	j = i + 1
	l = 1
	while j < n:
		if a[j] > a[j - 1]:
			l += 1
			j += 1
		else:
			break
	while i < j:
		b.append(l)
		i += 1
c = []
for i in range(1, n - 1):
	if a[i] <= a[i - 1] and a[i] <= a[i + 1]:
		c.append(i)
	if a[i] >= a[i - 1] and a[i] >= a[i + 1]:
		c.append(i)
d = []
d.append(max(b))
for i in c:
	if a[i] <= a[i - 1] and a[i] <= a[i + 1]:
		if a[i + 1] > a[i - 1]:
			d.append(b[i - 1] + b[i + 1] - 1)
	if a[i] >= a[i - 1] and a[i] >= a[i + 1]:
		if a[i + 1] > a[i - 1]:
			d.append(b[i - 1] - 1 + b[i + 1])
print(max(d))


N = int(input())
arr = list(map(int, input().split(' ')))
counts = set()
last = -1
for n in range(N):
	count = 1
	delite = False
	delited = -1
	i = n
	j = i + 1
	if n < last:
		continue
	while True:
		if j < N:
			if arr[i] < arr[j]:
				count += 1
				if not delite:
					last = i - 1
			elif not delite:
				if arr[i - 1] < arr[j] and i > 1:
					delited = i
					count -= 1
					i -= 2
					j -= 1
					delite = True
				elif j + 1 < N:
					if arr[i] < arr[j + 1]:
						delited = j
						i -= 1
						delite = True
					else:
						counts.add(count)
						break
				else:
					counts.add(count)
					break
			else:
				counts.add(count)
				break
			i += 1
			j += 1
			if i == delited:
				i += 1
			if j == delited:
				j += 1
		else:
			counts.add(count)
			break
print(max(counts))


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
n = int(input())
a = list(map(int, input().split()))
segm = []
st = 0
for i in range(1, n):
	if a[i - 1] >= a[i]:
		if i - 1 > st:
			segm.append((st, i - 1))
		st = i
if n - 1 > st:
	segm.append((st, n - 1))
if not segm:
	print(1)
	sys.exit()
elif len(segm) == 1:
	print(segm[0][1] - segm[0][0] + 1)
	sys.exit()
maxSegm = max(segm, key=lambda x: x[1] - x[0])
currMax = maxSegm[1] - maxSegm[0] + 1
for i in range(len(segm)):
	(st0, en0) = segm[i - 1]
	(st1, en1) = segm[i]
	if en0 + 2 == st1 and a[en0] < a[st1]:
		currMax = max(currMax, en1 - st0)
	elif en0 + 1 == st1 and (a[en0] < a[st1 + 1] or a[en0 - 1] < a[st1]):
		currMax = max(currMax, en1 - st0)
print(currMax)


n = int(input())
arr = list(map(int, input().split()))
incs = [1]
decs = [1]
inc = 1
dec = 1
ans = 0
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		inc += 1
	else:
		inc = 1
	incs.append(inc)
	ans = max(ans, inc)
	if arr[n - i] > arr[n - i - 1]:
		dec += 1
	else:
		dec = 1
	decs.append(dec)
decs.reverse()
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(ans, incs[i - 1] + decs[i + 1])
	else:
		ans = max(ans, incs[i - 1], decs[i + 1])
print(ans)


n = int(input())
ans = 1
x = [1 for i in range(n)]
y = [1 for i in range(n)]
s = list(map(int, input().split()))
for i in range(1, len(s)):
	if s[i] > s[i - 1]:
		x[i] = x[i - 1] + 1
	else:
		x[i] = 1
	ans = max(ans, x[i])
for i in range(len(s) - 2, -1, -1):
	if s[i] < s[i + 1]:
		y[i] = y[i + 1] + 1
	else:
		y[i] = 1
	ans = max(ans, y[i])
for i in range(1, len(s) - 1):
	if s[i - 1] < s[i + 1]:
		ans = max(ans, x[i - 1] + y[i + 1])
print(ans)


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
n = int(input())
l = list_input()
ans = 1
back = [1 for i in range(n)]
for i in range(n - 2, 0, -1):
	if l[i + 1] > l[i]:
		back[i] = back[i + 1] + 1
		ans = max(ans, back[i])
up = [1 for i in range(n)]
for i in range(1, n):
	if l[i] > l[i - 1]:
		up[i] = up[i - 1] + 1
		ans = max(ans, up[i])
for i in range(0, n - 2):
	if l[i] < l[i + 2]:
		ans = max(ans, up[i] + back[i + 2])
print(ans)


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	N = int(input())
	A = getlist()
	DP1 = [1] * N
	DP2 = [1] * N
	for i in range(N - 1):
		if A[i + 1] > A[i]:
			DP1[i + 1] = DP1[i] + 1
	for i in range(2, N - 1):
		if A[i] > A[i - 2]:
			DP2[i] = max(DP2[i], DP1[i - 2] + 1)
		if A[i + 1] > A[i]:
			DP2[i + 1] = DP2[i] + 1
	if N >= 3:
		if A[N - 1] > A[N - 3]:
			DP2[N - 1] = max(DP2[N - 1], DP1[N - 3] + 1)
	ans = 0
	for i in range(N):
		ans = max(ans, DP1[i])
	for i in range(N):
		ans = max(ans, DP2[i])
	print(ans)
main()


n = int(input())
arr = [int(i) for i in input().split()]

def maxsub(a):
	inc = [[a[0]]]
	for x in a[1:]:
		if x > inc[-1][-1]:
			inc[-1].append(x)
		else:
			inc.append([x])
	l = len(inc)
	for i in range(l - 1):
		if len(inc[i + 1]) == 1:
			if i + 2 < l:
				if inc[i][-1] < inc[i + 2][0]:
					inc[i] = inc[i] + inc[i + 2]
		else:
			(can, can2) = (inc[i], inc[i])
			if inc[i][-1] < inc[i + 1][1]:
				can = inc[i] + inc[i + 1][1:]
			if len(inc[i]) > 1:
				if inc[i][-2] < inc[i + 1][0]:
					can2 = inc[i][:-1] + inc[i + 1]
			if len(can) > len(can2):
				inc[i] = can
			else:
				inc[i] = can2
	for i in range(len(inc)):
		inc[i] = len(inc[i])
	return max(inc)
print(maxsub(arr))


n = int(input())
a = list(map(int, input().split()))
dp = [[1 for i in range(2)] for j in range(n)]
ans = -1
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[i][0] += dp[i - 1][0]
	ans = max(dp[i][0], ans)
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dp[i][1] += dp[i + 1][1]
for i in range(1, n - 1):
	if a[i + 1] > a[i - 1]:
		ans = max(ans, dp[i + 1][1] + dp[i - 1][0])
print(ans)


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7
n = int(input())
pre = [1 for i in range(n)]
preb = [1 for i in range(n)]
a = list(map(int, input().split()))
for i in range(1, n):
	if a[i] > a[i - 1]:
		pre[i] = pre[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		preb[i] = preb[i + 1] + 1
ans = max(pre)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, pre[i - 1] + preb[i + 1])
print(ans)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import deque
from heapq import heappush, heappop
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = 1
for _ in range(t):
	n = ip()
	arr = list(inp())
	dp1 = [1] * n
	sm = arr[0]
	ans = -1
	for i in range(1, n):
		if arr[i] > arr[i - 1]:
			dp1[i] = dp1[i - 1] + 1
		else:
			ans = max(ans, dp1[i])
	ans = max(ans, dp1[n - 1])
	dp2 = [1] * n
	for i in range(n - 1, 0, -1):
		if arr[i] > arr[i - 1]:
			dp2[i - 1] = dp2[i] + 1
		else:
			ans = max(ans, dp2[i])
	ans = max(ans, dp2[0])
	for i in range(n - 2):
		if arr[i + 2] > arr[i]:
			ans = max(ans, dp1[i] + dp2[i + 2])
	print(ans)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	n = get_int()
	arr = get_list()
	d = [1] * n
	d2 = [1] * n
	for i in range(1, n):
		if arr[i] > arr[i - 1]:
			d[i] = d[i - 1] + 1
			d2[i] = d2[i - 1] + 1
		if i > 1 and arr[i] > arr[i - 2]:
			d2[i] = max(d2[i], d[i - 2] + 1)
	return max(d2)

def main():
	print(solve())
TestCases = False
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


import sys
n = int(sys.stdin.readline().strip())
a = [int(i) for i in sys.stdin.readline().strip().split()]
a.append(-2000000000.0)
dp = [0] * (n + 1)
dp[0] = 1
bg = 0
for i in range(1, n + 1):
	if a[i] > a[i - 1]:
		dp[i] = dp[i - 1] + 1
	else:
		for j in range(bg, i):
			dp[j] = dp[i - 1]
		dp[i] = 1
		bg = i
cnt = 0
for i in range(1, n):
	cnt = max(cnt, dp[i])
	if a[i - 1] >= a[i] and a[i] < a[i + 1] and (a[i - 1] < a[i + 1]):
		cnt = max(cnt, dp[i - 1] + dp[i + 1] - 1)
	if a[i - 1] <= a[i] and a[i] > a[i + 1] and (a[i - 1] < a[i + 1]):
		cnt = max(cnt, dp[i - 1] + dp[i + 1] - 1)
sys.stdout.write(str(cnt))


n = int(input())
l = list(map(int, input().split()))
mass = []
p = [l[0]]
le = []
for i in range(1, n):
	if l[i] > l[i - 1]:
		p += [l[i]]
	else:
		mass += [p]
		le += [len(p)]
		p = [l[i]]
if len(p) > 0:
	le += [len(p)]
	mass += [p]
res = max(le)
for i2 in range(1, len(mass)):
	p = mass[i2]
	p2 = mass[i2 - 1]
	if le[i2] == 1 and i2 < len(mass) - 1:
		if mass[i2 + 1][0] > p2[-1]:
			res = max(res, len(mass[i2 + 1]) + len(p2))
		continue
	if le[i2 - 1] > 1 and le[i2] > 1:
		if p[1] > p2[-1]:
			res = max(res, le[i2] + le[i2 - 1] - 1)
		if p2[-2] < p[0]:
			res = max(res, le[i2] + le[i2 - 1] - 1)
print(res)


n = int(input())
arr = list(map(int, input().split()))
dp1 = [1] * n
dp2 = [1] * n
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		dp1[i] = dp1[i - 1] + 1
		dp2[i] = dp2[i - 1] + 1
	if i >= 2 and arr[i] > arr[i - 2]:
		dp2[i] = max(dp2[i], dp1[i - 2] + 1)
print(max(max(dp1), max(dp2)))


n = int(input())
a = list(map(int, input().split()))
sub = [1]
for i in range(1, n):
	if a[i] > a[i - 1]:
		sub.append(sub[-1] + 1)
	else:
		sub.append(1)
val = sub[n - 1]
aa = [0] * n
aa[n - 1] = 1
ans1 = max(sub)
for i in range(n - 2, -1, -1):
	if sub[i] < sub[i + 1]:
		aa[i] = val - sub[i] + 1
	else:
		val = sub[i]
		aa[i] = 1
ans = [0]
for i in range(2, n - 1):
	if a[i - 1] < a[i + 1]:
		ans.append(sub[i - 1] + aa[i + 1])
print(max(max(ans), ans1))


n = int(input())
a = list(map(int, input().split()))
pre = [1 for i in range(n)]
suf = [1 for i in range(n)]
maxa = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		pre[i] += pre[i - 1]
	maxa = max(maxa, pre[i])
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suf[i] += suf[i + 1]
	maxa = max(maxa, suf[i])
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		maxa = max(maxa, pre[i - 1] + suf[i + 1])
print(maxa)


n = int(input())
a = list(map(int, input().split()))
data1 = [1]
for i in range(1, n):
	if a[i] > a[i - 1]:
		data1.append(data1[-1] + 1)
	else:
		data1.append(1)
data2 = [1]
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		data2.append(data2[-1] + 1)
	else:
		data2.append(1)
data2 = data2[::-1]
ans = max(data1)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, data1[i - 1] + data2[i + 1])
print(ans)


n = int(input().strip())
a = [int(j) for j in input().strip().split()]
a.append(0)
b = [a[0]]
r = []
for i in range(len(a) - 1):
	left = a[i]
	right = a[i + 1]
	if right > left:
		b.append(right)
	else:
		r.append(b)
		b = [a[i + 1]]

def find_len(list1, list2, list3):
	max_len = max(len(list1), len(list2), len(list3))
	if len(list2) == 1:
		if list1[-1] < list3[0]:
			max_len = len(list1) + len(list3)
	else:
		if list2[1] > list1[-1]:
			m_len = len(list1) + len(list2) - 1
			if m_len > max_len:
				max_len = m_len
		if len(list1) >= 2:
			if list1[-2] < list2[0]:
				m_len = len(list1) + len(list2) - 1
				if m_len > max_len:
					max_len = m_len
		if list2[-2] < list3[0]:
			m_len = len(list3) + len(list2) - 1
			if m_len > max_len:
				max_len = m_len
		if len(list3) >= 2:
			if list3[1] > list2[-1]:
				m_len = len(list3) + len(list2) - 1
				if m_len > max_len:
					max_len = m_len
	return max_len
res = 0
if len(r) < 3:
	r.extend([[0], [0]])
for mi in range(len(r) - 2):
	l1 = r[mi]
	l2 = r[mi + 1]
	l3 = r[mi + 2]
	mr = find_len(l1, l2, l3)
	if mr > res:
		res = mr
print(res)


from sys import stdin, exit
from typing import List, Tuple
stdin.readline()
seq = [int(v) for v in stdin.readline().rstrip().split()]
r_max_seq = [0] * len(seq)
r_max_seq[-1] = 1
l_max_seq = [0] * len(seq)
l_max_seq[0] = 1
for i in range(len(seq) - 1, 0, -1):
	if seq[i - 1] < seq[i]:
		r_max_seq[i - 1] = r_max_seq[i] + 1
	else:
		r_max_seq[i - 1] = 1
for i in range(1, len(seq)):
	if seq[i - 1] < seq[i]:
		l_max_seq[i] = l_max_seq[i - 1] + 1
	else:
		l_max_seq[i] = 1
max_inc = max(l_max_seq)
for i in range(1, len(seq) - 1):
	if seq[i - 1] < seq[i + 1]:
		max_inc = max(max_inc, l_max_seq[i - 1] + r_max_seq[i + 1])
print(max_inc)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
n = int(input())
a = list(mapi())
dp = [1] * n
dp2 = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[i] = dp[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dp2[i] = dp2[i + 1] + 1
res = max(max(dp), max(dp2))
for i in range(n - 2):
	if a[i] < a[i + 2]:
		res = max(res, dp[i] + dp2[i + 2])
print(res)


n = int(input())
a = list(map(int, input().split()))
la = [1] * n
ra = [1] * n
ans = 1
for i in range(n - 1):
	if a[i] < a[i + 1]:
		ra[i + 1] = ra[i] + 1
		ans = max(ra[i + 1], ans)
for i in range(n - 1, 1, -1):
	if a[i] > a[i - 1]:
		la[i - 1] = la[i] + 1
		ans = max(ans, la[i - 1])
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, ra[i] + la[i + 2])
print(ans)


input()
nums = list(map(int, input().split()))
n = len(nums)
pure = [0] * n
skipped = [0] * n
pure[0] = 1
skipped[0] = 1
pure[1] = 2 if nums[0] < nums[1] else 1
skipped[1] = 1
for i in range(2, n):
	if nums[i] > nums[i - 1]:
		pure[i] = 1 + pure[i - 1]
		skipped[i] = 1 + skipped[i - 1]
		if nums[i] > nums[i - 2]:
			skipped[i] = max(skipped[i], 1 + pure[i - 2])
	else:
		pure[i] = 1
		if nums[i] > nums[i - 2]:
			skipped[i] = 1 + pure[i - 2]
		else:
			skipped[i] = 1
print(max(max(pure), max(skipped)))


n = int(input())
a = [int(i) for i in input().split()]
b = [1]
l = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		l += 1
		b.append(l)
	else:
		l = 1
		b.append(l)
l = b[-1]
c = [l]
for i in range(2, n + 1):
	if b[n - i] < b[n - i + 1]:
		c.append(l)
	else:
		l = b[n - i]
		c.append(l)
c = c[::-1]
ans = max(c)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, b[i - 1] + c[i + 1] - b[i + 1] + 1)
print(ans)


n = int(input())
arr = list(map(int, input().split()))
dp = [[1, 1] for i in range(n)]
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		dp[i][1] = dp[i - 1][1] + 1
		dp[i][0] = dp[i - 1][0] + 1
	if i > 1 and arr[i] > arr[i - 2]:
		dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
print(max((max(dp[i]) for i in range(n))))


from sys import stdin
n = int(stdin.readline())
arr = [int(x) for x in stdin.readline().split()]
flag = True
for i in range(n - 1):
	if not arr[i] < arr[i + 1]:
		flag = False
		break
if flag:
	print(n)
	quit()
ans = 1
possible = []
(prev, ptr) = (n - 1, n - 1)
while ptr > 0:
	while ptr > 0 and arr[ptr - 1] < arr[ptr]:
		ptr -= 1
	ans = max(ans, prev - ptr + 1)
	possible.append([ptr, prev])
	while ptr > 0 and (not arr[ptr - 1] < arr[ptr]):
		ptr -= 1
	prev = ptr
for i in range(len(possible) - 1, 0, -1):
	(start1, end1, start2, end2) = (possible[i][0], possible[i][1], possible[i - 1][0], possible[i - 1][1])
	if end1 + 2 == start2:
		if arr[end1] < arr[start2]:
			ans = max(ans, end1 - start1 + 1 + end2 - start2 + 1)
	elif end1 + 1 == start2:
		if start1 != end1 and start2 != end2:
			if arr[end1 - 1] < arr[start2] or arr[end1] < arr[start2 + 1]:
				ans = max(ans, end1 - start1 + end2 - start2 + 1)
print(ans)


drop = input()
elements = input().split(' ')
ri = []
li = []
for i in range(len(elements)):
	ri.append(1)
	li.append(1)
max1 = 1
for i in range(1, len(elements)):
	if int(elements[i]) > int(elements[i - 1]):
		li[i] = li[i - 1] + 1
		if li[i] > max1:
			max1 = li[i]
	if int(elements[-i]) > int(elements[-i - 1]):
		ri[-i - 1] = ri[-i] + 1
for i in range(len(elements) - 2):
	if int(elements[i]) < int(elements[i + 2]):
		if li[i] + ri[i + 2] > max1:
			max1 = li[i] + ri[i + 2]
print(max1)


n = int(input())
lis = list(map(int, input().split()))
dp = [0] * len(lis)
for i in range(len(lis) - 1, -1, -1):
	if i == len(lis) - 1:
		dp[i] = 1
		continue
	if lis[i] < lis[i + 1]:
		dp[i] = dp[i + 1] + 1
	else:
		dp[i] = 1
dp2 = [0] * len(lis)
for i in range(len(lis)):
	if i == 0:
		dp2[i] = 1
		continue
	if lis[i] > lis[i - 1]:
		dp2[i] = dp2[i - 1] + 1
	else:
		dp2[i] = 1
output = 0
for i in range(len(dp)):
	if i == 0:
		output = max(output, dp[i + 1])
		continue
	if i == len(dp) - 1:
		output = max(output, dp2[i - 1])
		continue
	if lis[i - 1] < lis[i + 1]:
		output = max(output, dp2[i - 1] + dp[i + 1])
	else:
		output = max(output, dp[i + 1])
output = max(max(dp), output)
print(output)


n = int(input().strip())
arr = list(map(int, input().strip().split()))
endAti = [0] * n
startAti = [0] * n
endAti[0] = 1
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		endAti[i] = endAti[i - 1] + 1
	else:
		endAti[i] = 1
startAti[-1] = 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		startAti[i] = startAti[i + 1] + 1
	else:
		startAti[i] = 1
ans = max(max(endAti), max(startAti))
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(ans, endAti[i - 1] + startAti[i + 1])
ans = max(ans, startAti[1])
ans = max(ans, endAti[-2])
print(ans)


from sys import stdin
n = int(input())
a = [int(x) for x in stdin.readline().split()]
l = [1 for i in range(n)]
r = [1 for i in range(n)]
ans = 1
for i in range(1, n):
	if a[i - 1] < a[i]:
		l[i] += l[i - 1]
	ans = max(ans, l[i])
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		r[i] += r[i + 1]
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
f = [[1, 0] for i in range(200002)]
use = [False for i in range(200002)]
ans = 1
if a[1] > a[0]:
	f[1][0] = 2
	ans = 2
for i in range(2, len(a)):
	u1 = 0
	u2 = 0
	v1 = 0
	if a[i] > a[i - 1]:
		u1 = f[i - 1][0]
		u2 = f[i - 1][1]
	if a[i] > a[i - 2]:
		v1 = f[i - 2][0]
	f[i][0] += u1
	f[i][1] = 1 + max(u2, v1)
	if f[i][1] == 1:
		f[i][1] = 0
	ans = max(f[i][0], f[i][1], ans)
print(ans)


import sys
import collections
from collections import Counter
import itertools
import math
import timeit

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
d = li()
p = [1]
rev = [1]
res = 1
for i in range(1, n):
	if d[i] > d[i - 1]:
		p.append(p[-1] + 1)
		res = max(res, p[-1])
	else:
		p.append(1)
for i in range(n - 2, -1, -1):
	if d[i] < d[i + 1]:
		rev.append(rev[-1] + 1)
	else:
		rev.append(1)
rev.reverse()
for i in range(1, n - 1):
	if d[i - 1] < d[i + 1]:
		res = max(res, p[i - 1] + rev[i + 1])
print(res)


n = int(input())
l = [int(x) for x in input().split()]
l.append(0)
l.insert(0, 987654321)
m = []
idx = 0
max = 0
for x in range(1, n + 2):
	if l[x - 1] >= l[x]:
		m.append([idx, x - 1, x - 1 - idx + 1])
		if x - 1 - idx + 1 > max:
			max = x - 1 - idx + 1
		idx = x
m.append([n + 1, n + 1, 1])
nm = len(m)
for x in range(1, nm - 1):
	if m[x][2] == 1:
		if l[m[x - 1][1]] < l[m[x + 1][0]]:
			if m[x - 1][2] + m[x + 1][2] > max:
				max = m[x - 1][2] + m[x + 1][2]
	else:
		if l[m[x - 1][1]] < l[m[x][0] + 1]:
			if m[x - 1][2] + m[x][2] - 1 > max:
				max = m[x - 1][2] + m[x][2] - 1
		if l[m[x][1] - 1] < l[m[x + 1][0]]:
			if m[x][2] + m[x + 1][2] - 1 > max:
				max = m[x][2] + m[x + 1][2] - 1
print(max)


import os
import sys
import bisect
from math import gcd, ceil
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline().decode('ascii')

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.setrecursionlimit(10000)
n = int(input())
a = list(map(int, input().split()))
forward = [1] * n
backward = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		forward[i] = forward[i - 1] + 1
for i in reversed(range(0, n - 1)):
	if a[i] < a[i + 1]:
		backward[i] = backward[i + 1] + 1
ans = -1
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, forward[i - 1] + backward[i + 1])
print(max(ans, max(forward)))


n = int(input())
arr = list(map(int, input().split()))
ind = 0
dp = []
co = 0
maxi = 1
for i in range(0, n - 1):
	if arr[i] >= arr[i + 1]:
		if ind == i:
			dp.append([ind])
			ind += 1
		else:
			if (len(dp) > 0 and len(dp[-1]) > 1) and (arr[dp[-1][1] - 1] < arr[ind] or arr[dp[-1][1]] < arr[ind + 1]):
				if maxi < dp[-1][1] - dp[-1][0] + i - ind + 1:
					maxi = dp[-1][1] - dp[-1][0] + i - ind + 1
			elif maxi < i - ind + 1:
				maxi = i - ind + 1
			dp.append([ind, i])
			ind = i + 1
i = n - 1
if ind == n - 1:
	dp.append([ind])
	ind += 1
else:
	if (len(dp) > 0 and len(dp[-1]) > 1) and (arr[dp[-1][1] - 1] < arr[ind] or arr[dp[-1][1]] < arr[ind + 1]):
		if maxi < dp[-1][1] - dp[-1][0] + i - ind + 1:
			maxi = dp[-1][1] - dp[-1][0] + i - ind + 1
	elif maxi < i - ind + 1:
		maxi = i - ind + 1
	dp.append([ind, n - 1])
print(maxi)


n = int(input())
x = [int(i) for i in input().split()]
y = x[::-1]
lst1 = [1] * n
lst2 = [1] * n
for i in range(1, n):
	if x[i - 1] < x[i]:
		lst1[i] += lst1[i - 1]
for i in range(n - 1):
	if y[i] > y[i + 1]:
		lst2[-i - 2] += lst2[-i - 1]
res = max(lst1)
for i in range(n - 2):
	if x[i + 2] > x[i]:
		res = max(res, lst1[i] + lst2[i + 2])
print(res)


n = int(input())
a = list(map(int, input().split()))
forward = [1] * n
backward = [1] * n
ans = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		forward[i] = forward[i + 1] + 1
	ans = max(ans, forward[i])
for i in range(1, n):
	if a[i - 1] < a[i]:
		backward[i] = backward[i - 1] + 1
	ans = max(ans, backward[i])
for i in range(n - 2):
	if a[i] - a[i + 2] < 0:
		ans = max(ans, forward[i + 2] + backward[i])
print(ans)


import sys
ip = lambda : sys.stdin.readline().rstrip()
from collections import Counter
n = int(ip())
a = list(map(int, ip().split()))
dp = [[1, False] for _ in range(n)]
dp[0][0] = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		if dp[i][0] < 1 + dp[i - 1][0]:
			dp[i][0] = 1 + dp[i - 1][0]
			if dp[i - 1][1]:
				dp[i][1] = True
	if i - 2 >= 0 and a[i] > a[i - 2]:
		if not dp[i - 2][1]:
			if dp[i][0] < 1 + dp[i - 2][0]:
				dp[i][0] = 1 + dp[i - 2][0]
				dp[i][1] = True
v = max(dp, key=lambda x: max(x[0], x[1]))
print(max(v))


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
l = il()
l1 = [1] * n
l2 = [1] * n
for i in range(1, n):
	if l[i - 1] < l[i]:
		l1[i] += l1[i - 1]
for i in range(n - 2, -1, -1):
	if l[i + 1] > l[i]:
		l2[i] += l2[i + 1]
mx = max(l1)
for i in range(n - 2):
	if l[i + 2] > l[i]:
		mx = max(mx, l1[i] + l2[i + 2])
print(mx)


N = int(input())
L = list(map(int, input().split()))
dp = [[0] * 2 for _ in range(N)]
dp[0][0] = 1
ans = 1
for i in range(1, N):
	if L[i - 1] < L[i]:
		dp[i][0] = dp[i - 1][0] + 1
		dp[i][1] = dp[i - 1][1] + 1
		if i >= 2 and L[i - 2] < L[i]:
			dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
		ans = max(ans, dp[i][0], dp[i][1])
	else:
		dp[i][0] = 1
		dp[i][1] = dp[i - 2][0] + 1 if i >= 2 and L[i - 2] < L[i] else 0
		ans = max(ans, dp[i][1])
print(ans)


n = int(input())
arr = list(map(int, input().split()))
start = 0
prev = arr[0]
subarrays = []
for (i, v) in enumerate(arr):
	if i == 0:
		continue
	if v <= prev:
		if i - start > 1:
			subarrays.append((start, i - 1))
		start = i
	prev = v
i += 1
if i - start > 1:
	subarrays.append((start, i - 1))
start = i
c_max = 1
for subarray in subarrays:
	c_max = max(c_max, subarray[1] - subarray[0] + 1)
for j in range(len(subarrays) - 1):
	left = subarrays[j]
	right = subarrays[j + 1]
	if right[0] == left[1] + 1 and arr[right[0] + 1] > arr[left[1]]:
		c_max = max(c_max, left[1] - left[0] + 1 + right[1] - right[0])
	if right[0] == left[1] + 1 and arr[right[0]] > arr[left[1] - 1]:
		c_max = max(c_max, left[1] - left[0] + 1 + right[1] - right[0])
print(c_max)


n = int(input())
xs = [int(x) for x in input().split()]
dp0 = [1 for _ in range(n)]
dp1 = [1 for _ in range(n)]
for i in range(1, n):
	dp0[i] = dp0[i - 1] + 1 if xs[i] > xs[i - 1] else 1
	if i > 1:
		left = dp1[i - 1] + 1 if xs[i] > xs[i - 1] else 1
		right = dp0[i - 2] + 1 if xs[i] > xs[i - 2] else 1
		dp1[i] = max(left, right)
best = max(max(dp0), max(dp1))
print(best)


n = int(input())
a = list(map(int, input().split(' ')))
listas = [[a[0]]]
j = 0
for i in range(0, len(a) - 1):
	if a[i + 1] > a[i]:
		listas[j].append(a[i + 1])
	else:
		j += 1
		listas.append([])
		listas[j].append(a[i + 1])
long = []
for i in range(0, len(listas)):
	long.append(len(listas[i]))
for i in range(0, len(listas) - 1):
	if listas[i][len(listas[i]) - 2] < listas[i + 1][0]:
		long.append(len(listas[i]) + len(listas[i + 1]) - 1)
	elif len(listas[i + 1]) >= 2 and listas[i][len(listas[i]) - 1] < listas[i + 1][1]:
		long.append(len(listas[i]) + len(listas[i + 1]) - 1)
print(max(long))


def play(arr):
	n = len(arr)
	if n == 1:
		return 1
	l = [0] * n
	r = [0] * n
	s = 0
	for i in range(1, n):
		if arr[i] > arr[i - 1]:
			s += 1
			l[i] = s
		else:
			s += 1
			l[i] = s
			s = 0
	s = 0
	for i in range(n - 2, -1, -1):
		if arr[i + 1] > arr[i]:
			s += 1
			r[i] = s
		else:
			s += 1
			r[i] = s
			s = 0
	m = 1
	for i in range(0, n):
		if i > 0:
			if i < n - 1:
				if arr[i - 1] >= arr[i + 1]:
					if arr[i] > arr[i - 1]:
						m = max(m, l[i] + 1)
					if arr[i] < arr[i + 1]:
						m = max(m, r[i] + 1)
					m = max(m, l[i], r[i])
				elif arr[i] > arr[i - 1] and arr[i] < arr[i + 1]:
					m = max(m, l[i] + r[i] + 1)
				else:
					m = max(m, l[i] + r[i])
			elif arr[i] > arr[i - 1]:
				m = max(m, l[i] + 1)
			else:
				m = max(m, l[i])
		elif arr[i] < arr[i + 1]:
			m = max(m, r[i] + 1)
		else:
			m = max(m, r[i])
	return m

def main():
	n = list(map(int, input().split()))[0]
	arr = list(map(int, input().split()))
	print(play(arr))
main()


x = input()
a = list(map(int, input().split()))
(m, clast, cnow) = (1, 0, 1)
last = 1
for i in range(1, len(a)):
	if a[i] > a[i - 1]:
		cnow += 1
		m = max(m, cnow)
	else:
		if clast > 1 and cnow > 1:
			if a[last - 1] < a[last + 1] or a[last] < a[last + 2]:
				m = max(m, clast + cnow - 1)
		if cnow > 1:
			last = i - 1
			clast = cnow
		else:
			clast = 0
		cnow = 1
if clast > 1 and cnow > 1:
	if a[last - 1] < a[last + 1] or a[last] < a[last + 2]:
		m = max(m, clast + cnow - 1)
print(m)


import math
n = int(input())
arr = list(map(int, input().split()))
right = [1] * n
left = [1] * n
ans = 0
for i in range(n - 2, -1, -1):
	if arr[i + 1] > arr[i]:
		right[i] = right[i + 1] + 1
	ans = max(ans, right[i])
for i in range(1, n):
	if arr[i - 1] < arr[i]:
		left[i] = left[i - 1] + 1
	ans = max(left[i], ans)
for i in range(n - 2):
	if arr[i] < arr[i + 2]:
		ans = max(ans, left[i] + right[i + 2])
print(ans)


n = int(input())
a = list(map(int, input().split()))
d = [1] * n
d2 = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		d[i] = d[i - 1] + 1
		d2[i] = d2[i - 1] + 1
	if i >= 2 and a[i] > a[i - 2]:
		d2[i] = max(d2[i], d[i - 2] + 1)
print(max(d2))


n = int(input())
l = list(map(int, input().split()))
res = []
temp = [l[0]]
for j in range(1, n + 1):
	if j != n and l[j] > l[j - 1]:
		temp.append(l[j])
	else:
		res.append(temp)
		temp = [l[j]] if j != n else 0
max_length = 0
for j in range(len(res)):
	max_length = max(max_length, len(res[j]))
for j in range(1, len(res)):
	if len(res[j - 1]) > 1 and res[j][0] > res[j - 1][-2] or (len(res[j]) > 1 and res[j][1] > res[j - 1][-1]):
		max_length = max(max_length, len(res[j]) + len(res[j - 1]) - 1)
print(max_length)


n = int(input())
l = [int(x) for x in input().split()]
a = []
b = []
j = 0
last = 0
for i in l:
	if j < i:
		a.append(last + 1)
		last += 1
	else:
		a.append(1)
		last = 1
	j = i
j = 10 ** 10
last = 0
for i in range(n - 1, -1, -1):
	if l[i] < j:
		b.append(last + 1)
		last += 1
	else:
		b.append(1)
		last = 1
	j = l[i]
b = b[::-1]
end = a
start = b
m = max(max(end), max(start))
for i in range(1, n - 1):
	if l[i - 1] < l[i + 1]:
		m = max(m, end[i - 1] + start[i + 1])
print(m)


n = int(input())
mass = list(map(int, input().split()))
left = [1] * n
right = [1] * n
for i in range(1, n):
	if mass[i] > mass[i - 1]:
		left[i] = left[i - 1] + 1
for i in range(n - 2, -1, -1):
	if mass[i] < mass[i + 1]:
		right[i] = right[i + 1] + 1
mx = 1
for i in range(n):
	if i == 0:
		mx = max(right[0], mx)
	elif i == n - 1:
		mx = max(mx, left[n - 1])
	elif mass[i + 1] > mass[i - 1]:
		mx = max(mx, left[i - 1] + right[i + 1])
	mx = max(mx, left[i])
	mx = max(mx, right[i])
print(mx)


n = int(input().strip())
A = list(map(int, input().strip().split()))
max_l = 0
dp = (0, 0)
last = -10000000000000000000000
for (i, a) in enumerate(A):
	if a > last:
		dp = (dp[0] + 1, dp[1] + 1)
	elif i > 1 and a > A[i - 2] or (i < n - 1 and A[i + 1] > A[i - 1]):
		dp = (1, dp[0])
	else:
		dp = (1, 1)
	max_l = max(max_l, dp[1])
	last = a
print(max_l)


n = int(input())
ns = [int(x) for x in input().split(' ')]
l = [0 for x in ns]
r = [0 for x in ns]
l[0] = 1
ans = 0
for i in range(1, n):
	if ns[i] > ns[i - 1]:
		l[i] = l[i - 1] + 1
		ans = max(ans, l[i])
	else:
		l[i] = 1
r[n - 1] = 1
for i in range(n - 2, -1, -1):
	if ns[i] < ns[i + 1]:
		r[i] = r[i + 1] + 1
	else:
		r[i] = 1
for i in range(n - 2, 0, -1):
	if ns[i + 1] > ns[i - 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(max(ans, r[0]))


import sys
input = sys.stdin.buffer.readline
n = int(input())
data = [int(i) for i in input().split()]
l = [1]
idx = [0]
for i in range(1, len(data)):
	if data[i] > data[i - 1]:
		l[-1] += 1
	else:
		l.append(1)
		idx.append(i)
max_length = 0
for i in range(1, len(idx)):
	index = idx[i]
	if l[i] > 1 and (data[index - 2] < data[index] or data[index - 1] < data[index + 1]):
		max_length = max(max_length, l[i] + l[i - 1] - 1)
print(max(max(l), max_length))


n = int(input())
a = list(map(int, input().split()))
diff1 = []
for i in range(1, n):
	diff1.append(a[i] - a[i - 1])
from collections import deque
diff2 = deque()
for i in range(n - 2, -1, -1):
	diff2.appendleft(a[i] - a[i + 1])

def aze(d):
	i = 0
	j = 1
	ans = []
	while i < n - 1:
		if d[i] <= 0:
			ans.append(j)
			j = 1
		else:
			ans.append(j)
			j += 1
		i += 1
	return ans

def aze2(d):
	i = n - 2
	j = 1
	ans = deque()
	while i > -1:
		if d[i] >= 0:
			ans.appendleft(j)
			j = 1
		else:
			ans.appendleft(j)
			j += 1
		i -= 1
	return ans
ans1 = aze(diff1)
ans2 = list(aze2(list(diff2)))
m = max(ans2[0], ans1[n - 2])
cnt = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		cnt += 1
	else:
		cnt = 1
	m = max(m, cnt)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		m = max(m, ans1[i - 1] + ans2[i])
	else:
		m = max([m, ans1[i - 1], ans2[i]])
print(m)


n = int(input())
a = list(map(int, input().split()))
ls = []
i = 0
while i < len(a):
	b = []
	b.append(a[i])
	i += 1
	while i < len(a):
		if b[-1] < a[i]:
			b.append(a[i])
		else:
			break
		i += 1
	ls.append(b)
mx = len(ls[0])
for i in range(len(ls) - 1):
	val = 1
	if len(ls[i + 1]) > 1:
		if ls[i][-1] < ls[i + 1][1]:
			val = len(ls[i] + ls[i + 1]) - 1
	if len(ls[i]) > 1:
		if ls[i][-2] < ls[i + 1][0]:
			val = len(ls[i] + ls[i + 1]) - 1
	val = max(val, len(ls[i]), len(ls[i + 1]))
	if val > mx:
		mx = val
print(mx)


from sys import stdin, stdout
from math import gcd, sqrt, factorial
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 0 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
n = max(I(), 3)
a = L() + [0]
l = [1]
r = [1]
cnt = 1
pst = a[0]
for i in a[1:]:
	if i > pst:
		cnt += 1
	else:
		cnt = 1
	pst = i
	l += (cnt,)
pst = a[-1]
cnt = 1
for i in a[::-1][1:]:
	if i < pst:
		cnt += 1
	else:
		cnt = 1
	pst = i
	r += (cnt,)
ans = max(max(l), max(r))
r.reverse()
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = int(1000000000.0) + 7
MAX = int(200000.0) + 1

def solve():
	n = int(input())
	arr = array()
	n = len(arr)
	inc = [1 for i in range(n)]
	dec = [1 for i in range(n)]
	ans = 1
	for i in range(1, n):
		if arr[i - 1] < arr[i]:
			inc[i] = inc[i - 1] + 1
			ans = max(ans, inc[i])
	for i in range(n - 2, -1, -1):
		if arr[i] < arr[i + 1]:
			dec[i] = dec[i + 1] + 1
			ans = max(ans, dec[i])
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i + 1]:
			ans = max(ans, inc[i - 1] + dec[i + 1])
	print(ans)

def main():
	t = 1
	for _ in range(t):
		solve()

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))
main()


n = int(input())
l = list(map(int, input().split()))
p = [0] * n
z = [0] * n
i = 0
d = 1
while i < len(l):
	cnt = 1
	pi = i
	pj = i + 1
	while pj < len(l):
		if l[pj] > l[pi]:
			cnt += 1
		else:
			break
		pj += 1
		pi += 1
	j = i
	k1 = 1
	k2 = cnt
	while k1 <= cnt:
		p[j] = (k1, k2)
		z[j] = d
		k1 += 1
		k2 -= 1
		j += 1
	i = j
	d += 1
m = 0
for i in range(n):
	if i < 2:
		x = p[i][1]
	else:
		e1 = p[i][1]
		e2 = -1
		if l[i] > l[i - 2] and z[i - 2] != z[i]:
			e2 = e1 + p[i - 2][0]
		x = max(e1, e2)
	if x > m:
		m = x
print(m)


n = int(input())
a = list(map(int, input().split()))
b = a[::-1]
arr = [1] * n
arr2 = [1] * n
for i in range(n - 1):
	if a[i] < a[i + 1]:
		arr[i + 1] += arr[i]
for i in range(n - 1):
	if b[i] > b[i + 1]:
		arr2[-i - 2] += arr2[-i - 1]
ans = max(arr)
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, arr[i] + arr2[i + 2])
print(ans)


from sys import stdin, stdout
get_string = lambda : stdin.readline().strip()
get_intmap = lambda : map(int, get_string().split())

def testcase():
	n = int(input())
	t = tuple(get_intmap())
	(last_seen_val_left, curr_max_left) = (0, 0)
	dp_left = [0] * n
	for ind in range(n):
		if last_seen_val_left >= t[ind]:
			curr_max_left = 1
		else:
			curr_max_left += 1
		dp_left[ind] = curr_max_left
		last_seen_val_left = t[ind]
	(last_seen_val_right, curr_max_right) = (int(10000000000.0), 0)
	dp_right = [0] * n
	for ind in range(n - 1, -1, -1):
		if t[ind] >= last_seen_val_right:
			curr_max_right = 1
		else:
			curr_max_right += 1
		dp_right[ind] = curr_max_right
		last_seen_val_right = t[ind]
	result = max(dp_left)
	for ind in range(1, n - 1):
		tmp = dp_left[ind - 1] + (dp_right[ind + 1] if t[ind + 1] > t[ind - 1] else 0)
		result = max(result, tmp)
	print(result)
testcase()


n = int(input())
l = list(map(int, input().split()))
x = 1
l1 = [1] * n
l1[0] = 1
ans = 1
temp = 1
for i in range(1, n):
	if l[i] > l[i - 1]:
		ans += 1
		temp = max(temp, ans)
	else:
		ans = 1
ans = temp
for i in range(1, n):
	if l[i] > l[i - 1]:
		l1[i] = l1[i - 1] + 1
	else:
		l1[i] = x
l2 = [1] * n
l2[n - 1] = 1
for i in range(n - 2, -1, -1):
	if l[i] < l[i + 1]:
		l2[i] = l2[i + 1] + 1
	else:
		l2[i] = x
for i in range(1, n - 1):
	if l[i + 1] > l[i - 1]:
		ans = max(ans, l1[i - 1] + l2[i + 1])
print(ans)


n = int(input())
nums = list(map(int, input().strip().split()))
curUsed = [0 for i in range(n)]
curUnused = [0 for i in range(n)]
curUnused[0] = 1
ans = 1
for i in range(1, n):
	if nums[i] > nums[i - 1]:
		curUnused[i] = curUnused[i - 1] + 1
		curUsed[i] = curUsed[i - 1] + 1
	else:
		curUnused[i] = 1
		curUsed[i] = 1
	if i >= 2 and nums[i] > nums[i - 2]:
		curUsed[i] = max(curUnused[i - 2] + 1, curUsed[i])
	ans = max(curUsed[i], ans)
	ans = max(ans, curUnused[i])
print(ans)


n = int(input())
a = list(map(int, input().split()))
dp = [[a[0]]]
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[-1].append(a[i])
	else:
		dp.append([a[i]])
maxm = 1
for x in dp:
	maxm = max(maxm, len(x))
m = len(dp)
for i in range(m):
	if len(dp[i]) == 1:
		if i + 1 < m and i - 1 >= 0 and (dp[i + 1][0] > dp[i - 1][-1]):
			maxm = max(len(dp[i - 1] + dp[i + 1], maxm))
	else:
		if i > 0 and dp[i - 1][-1] < dp[i][1]:
			maxm = max(maxm, len(dp[i - 1]) + len(dp[i]) - 1)
		if i + 1 < m and dp[i][-2] < dp[i + 1][0]:
			maxm = max(maxm, len(dp[i]) + len(dp[i + 1]) - 1)
print(maxm)


n = int(input())
a = list(map(int, input().split()))
dp = [[0, 0] for i in range(n + 1)]
dp[1][0] = 1
dp[1][1] = 1
for i in range(2, n + 1):
	if a[i - 1] > a[i - 2]:
		dp[i][0] = dp[i - 1][0] + 1
		dp[i][1] = dp[i - 1][1] + 1
	else:
		dp[i][0] = 1
		dp[i][1] = 1
	if i - 3 >= 0 and a[i - 1] > a[i - 3]:
		dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1)
ans = 0
for i in range(n + 1):
	ans = max(ans, dp[i][0], dp[i][1])
print(ans)


n = int(input())
l = list(map(int, input().split(' ')))
lefts = []
leftsc = []
rights = []
rightsc = []
b = 0
for i in range(0, n - 1):
	if b == 0:
		if l[i] < l[i + 1]:
			b = 1
			lefts.append(l[i])
			leftsc.append(i)
		else:
			lefts.append(l[i])
			leftsc.append(i)
			rights.append(l[i])
			rightsc.append(i)
	if l[i] >= l[i + 1] and b == 1:
		b = 0
		rights.append(l[i])
		rightsc.append(i)
if l[n - 2] < l[n - 1]:
	rights.append(l[n - 1])
	rightsc.append(n - 1)
else:
	lefts.append(l[n - 1])
	leftsc.append(n - 1)
	rights.append(l[n - 1])
	rightsc.append(n - 1)
maxl = 0
for i in range(len(lefts)):
	maxl = max(maxl, rightsc[i] - leftsc[i] + 1)
if len(lefts) == 1:
	print(rightsc[0] - leftsc[0] + 1)
	exit(0)
for i in range(len(lefts) - 1):
	if rights[i] >= lefts[i + 1]:
		if rightsc[i] - 1 >= 0:
			if l[rightsc[i] - 1] < lefts[i + 1]:
				if maxl < rightsc[i + 1] - leftsc[i]:
					maxl = rightsc[i + 1] - leftsc[i]
		if rightsc[i] + 1 < n:
			if leftsc[i + 1] + 1 < n:
				if l[rightsc[i]] < l[leftsc[i + 1] + 1]:
					if maxl < rightsc[i + 1] - leftsc[i]:
						maxl = rightsc[i + 1] - leftsc[i]
print(maxl)


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
	return pow(10, 9) + 7

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
n = INI()
X = INL()
x = 1
D = []
for _ in range(n - 1):
	if X[_] < X[_ + 1]:
		x += 1
	else:
		D.append([x, _])
		x = 1
D.append([x, _])
d = len(D)
ans = D[0][0]
if n == 2:
	if X[0] < X[1]:
		OPS(2)
	else:
		OPS(1)
else:
	for _ in range(d - 1):
		i = D[_][1]
		if i == 0:
			if X[i] < X[i + 2]:
				ans = max(ans, D[_][0] + D[_ + 1][0] - 1)
			else:
				ans = max(ans, D[_][0])
		elif i == n - 2 or i == n - 1:
			ans = max(ans, D[_][0])
		elif X[i] < X[i + 2] or X[i - 1] < X[i + 1]:
			ans = max(ans, D[_][0] + D[_ + 1][0] - 1)
		else:
			ans = max(ans, D[_][0])
	OPS(max(ans, D[-1][0]))


n = int(input())
a = list(map(int, input().split()))
pre = [0] * n
suff = [0] * n
pre[0] = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		pre[i] = pre[i - 1] + 1
	else:
		pre[i] = 1
suff[n - 1] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suff[i] = suff[i + 1] + 1
	else:
		suff[i] = 1
ans = pre[0]
ans = max(pre[n - 1], ans)
ans = max(ans, suff[0])
ans = max(suff[n - 1], ans)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, pre[i - 1] + suff[i + 1])
	ans = max(ans, pre[i])
print(ans)


import sys
import itertools as it
import math as mt
import collections as cc
import bisect as bi
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
left = [1] * n
right = [1] * n
for i in range(1, n):
	if l[i] > l[i - 1]:
		left[i] += left[i - 1]
for i in range(n - 2, -1, -1):
	if l[i] < l[i + 1]:
		right[i] += right[i + 1]
now = max(left)
temp = [now]
for i in range(1, n - 1):
	if l[i - 1] < l[i + 1]:
		temp.append(left[i - 1] + right[i + 1])
print(max(temp))


n = int(input())
a = [int(x) for x in input().split()]
i = 1
d = []
maxi = 0
while i < n:
	c = 1
	j = i
	while i < n and a[i] > a[i - 1]:
		i += 1
		c += 1
	d.append([c, j, i])
	i += 1
	maxi = max(maxi, d[-1][0])
for i in range(len(d) - 1):
	if a[d[i][2] - 2] < a[d[i + 1][1] - 1] or (d[i + 1][1] != n and a[d[i][2] - 1] < a[d[i + 1][1]]):
		maxi = max(maxi, d[i][0] + d[i + 1][0] - 1)
print(maxi)


n = int(input())
lst = [*map(int, input().split())]
(d, item, j) = ({0: 1}, [[lst[0]]], 0)
res = 0
for (i, x) in enumerate(lst[1:]):
	if x > lst[i]:
		d[j] += 1
		item[-1].append(x)
	else:
		res = max(res, d[j])
		j += 1
		d[j] = 1
		item.append([x])
res = max(res, d[j])
for (i, x) in enumerate(item[:-1]):
	if d[i] > 1 and d[i + 1] > 1:
		y = item[i + 1]
		if x[-1] < y[1]:
			res = max(res, d[i] + d[i + 1] - 1)
		if x[-2] < y[0]:
			res = max(res, d[i] + d[i + 1] - 1)
print(res)


def solve(lst):
	dp = [[1, 1] for _ in range(len(lst))]
	val = 0
	for i in range(1, len(lst)):
		if lst[i] > lst[i - 1]:
			dp[i][0] = max(dp[i - 1][0] + 1, dp[i][0])
			dp[i][1] = max(dp[i - 1][1] + 1, dp[i][1])
		if i > 1 and lst[i] > lst[i - 2]:
			dp[i][1] = max(dp[i - 2][0] + 1, dp[i][1])
		val = max(val, dp[i][0], dp[i][1])
	return val
n = input()
lst = list(map(int, list(input().split())))
print(solve(lst))


import sys

def rl():
	return sys.stdin.readline()

def compute(A, N):
	A.append(0)
	st = 0
	n = A[0]
	l = []
	for (i, v) in enumerate(A[1:]):
		if v <= n:
			l.append((st, i))
			st = i + 1
		n = v
	max1 = l[0][1] - l[0][0] + 1
	for i in range(1, len(l)):
		if l[i][0] - l[i - 1][1] == 1:
			if l[i][1] - l[i][0] + 1 > 1 and A[l[i][0] + 1] > A[l[i - 1][1]] or (l[i - 1][1] - l[i - 1][0] + 1 > 1 and A[l[i][0]] > A[l[i - 1][1] - 1]):
				c = l[i][1] - l[i - 1][0]
			else:
				c = l[i][1] - l[i][0] + 1
		else:
			c = l[i][1] - l[i][0] + 1
		max1 = max(max1, c)
	print(max1)

def main():
	N = int(rl())
	A = list(map(int, rl().split()))
	compute(A, N)
main()


n = int(input())
li = list(map(int, input().split()))
pre_dp = [1] * n
suff_dp = [1] * n
for i in range(1, n):
	if li[i - 1] < li[i]:
		pre_dp[i] = pre_dp[i - 1] + 1
for i in range(n - 2, -1, -1):
	if li[i] < li[i + 1]:
		suff_dp[i] = suff_dp[i + 1] + 1
res = 0
for i in range(n):
	res = max(res, max(pre_dp[i], suff_dp[i]))
for i in range(1, n - 1):
	if li[i - 1] < li[i + 1]:
		res = max(res, pre_dp[i - 1] + suff_dp[i + 1])
print(res)


n = int(input())
a = [int(_) for _ in input().split()]
l1 = []
l2 = [a[0]]
l3 = []
for i in range(1, n):
	if a[i] > a[i - 1]:
		l2.append(a[i])
	else:
		l1.append(l2[:])
		l2.clear()
		l2.append(a[i])
l1.append(l2)
for i in l1:
	l3.append(len(i))
max_ = max(l3)
for i in range(1, len(l3) - 1):
	if l3[i] == 1 and l1[i - 1][-1] < l1[i + 1][0] and (l3[i - 1] + l3[i + 1] > max_):
		max_ = l3[i - 1] + l3[i + 1]
for i in range(len(l3) - 1):
	shit = 0
	if l3[i] > 1 and l3[i + 1] > 1:
		if l1[i][-2] < l1[i + 1][0]:
			shit = l3[i] + l3[i + 1] - 1
		elif l1[i][-1] < l1[i + 1][1]:
			shit = l3[i] + l3[i + 1] - 1
	if shit > max_:
		max_ = shit
print(max_)


n = int(input())
arr = list(map(int, input().split()))
m = 1
l = 1
fw = [1] * n
bw = [1] * n
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		l = l + 1
		m = max(m, l)
	else:
		l = 1
	fw[i] = l
l = 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		l = l + 1
		m = max(m, l)
	else:
		l = 1
	bw[i] = l
ans = m
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		ans = max(ans, fw[i - 1] + bw[i + 1])
	else:
		ans = max(ans, fw[i - 1], bw[i + 1])
print(ans)


n = int(input())
array = input()
array = [int(x) for x in array.split()]
L = len(array)
if n == 1:
	print(1)
	exit()
elif n == 0:
	print(0)
	exit()
A = [[1, -1], [1, -1]]
nj = 1
if array[1] > array[0]:
	nj += 1
A[1][0] = nj
ans = nj
for i in range(2, L):
	if array[i] > array[i - 1]:
		nj += 1
	else:
		nj = 1
	A.append([nj, -1])
	if array[i] > array[i - 2]:
		j = A[i - 2][0] + 1
		jj = 1
		if array[i] > array[i - 1]:
			jj = A[i - 1][1] + 1
		A[i][1] = max([j, jj])
	elif array[i] > array[i - 1] and A[i - 1][1] != -1:
		A[i][1] = A[i - 1][1] + 1
	m = max(A[i])
	if ans < m:
		ans = m
print(ans)


n = int(input())
arr = list(map(int, input().split()))
dp = [1] * n
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		dp[i] = dp[i - 1] + 1
ds = [1] * n
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		ds[i] = ds[i + 1] + 1
ys = 0
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		xs = dp[i - 1] + ds[i + 1]
		ys = max(ys, xs)
print(max(ys, max(dp)))


n = int(input())
a = list(map(int, input().split())) + [0]
(x, y, r) = (1, 1, 1)
if a[1] > a[0]:
	(x, y) = (x + 1, y + 1)
for i in range(2, n):
	if a[i] > a[i - 1]:
		(x, y) = (x + 1, y + 1)
	else:
		r = max(r, x)
		x = y if a[i] > a[i - 2] or a[i + 1] > a[i - 1] else 1
		y = 1
print(max(r, x))


import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
ANS = [0] * n
count = 1
ANS[0] = 1
ANS2 = [0] * n
ucount = 0
for i in range(1, n):
	if A[i] > A[i - 1]:
		count += 1
		ANS[i] = count
		if ucount > 0:
			ucount += 1
			ANS2[i] = ucount
	else:
		count = 1
		ANS[i] = count
		ucount = 0
	if i >= 2 and A[i - 2] < A[i]:
		ucount = max(ucount, ANS[i - 2] + 1)
		ANS2[i] = ucount
print(max(max(ANS), max(ANS2)))


def arr_inp():
	return [float(x) for x in stdin.readline().split()]
from sys import *
from collections import *
(n, a, ans, mem, mem2) = (int(input()), arr_inp(), 0, deque([]), deque([]))
if n == 2:
	if a[0] < a[1]:
		exit(print(2))
	else:
		exit(print(1))
(mi, ma, l) = (0, 0, 0)
for i in range(n):
	if a[i] > mi:
		l += 1
		mi = a[i]
	else:
		ans = max(ans, l)
		(mi, l) = (a[i], 1)
	mem.append(l)
ans = max(ans, l)
ma = mem[n - 1]
mem2.appendleft(ma)
for i in range(n - 2, -1, -1):
	if mem[i] < mem[i + 1]:
		mem2.appendleft(ma)
	else:
		ma = mem[i]
		mem2.appendleft(ma)
for i in range(1, n - 1):
	if a[i + 1] > a[i - 1] and (a[i] >= a[i + 1] or a[i] <= a[i - 1]):
		if mem2[i] == mem2[i - 1] or mem2[i] == mem2[i + 1]:
			ans = max(ans, mem2[i + 1] + mem2[i - 1] - 1)
		else:
			ans = max(ans, mem2[i + 1] + mem2[i - 1])
print(ans)


from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def isprime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return 0
	return 1

def solve():
	n = ii()
	a = li()
	ans = 0
	pre = [1] * n
	c = 1
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			c = 1
		else:
			c += 1
		pre[i] = c
	suff = [1] * n
	c = 1
	for i in range(n - 2, -1, -1):
		if a[i] >= a[i + 1]:
			c = 1
		else:
			c += 1
		suff[i] = c
	ans = max(ans, suff[0])
	for i in range(1, n - 1):
		ans = max(ans, pre[i])
		x = pre[i - 1]
		if a[i - 1] < a[i + 1]:
			x += suff[i + 1]
		ans = max(ans, suff[i])
		ans = max(ans, x)
	ans = max(ans, pre[n - 1])
	print(ans)
solve()


from sys import stdin
read = stdin.readline

def main():
	n = int(read())
	nums = list(map(int, read().strip().split()))
	(inclass, ac, edges, cnt) = (dict(), 1, list(), 0)
	for num in nums:
		inclass[num] = 0
	for i in range(len(nums) - 1):
		if nums[i + 1] > nums[i]:
			ac += 1
		else:
			ac_temp = ac - 1
			inclass[nums[i]] = (ac, cnt)
			j = i - 1
			while ac_temp > 0:
				inclass[nums[j]] = (ac, cnt)
				j -= 1
				ac_temp -= 1
			ac = 1
			edges.append(i + 1)
			cnt += 1
	i = len(nums) - 1
	ac_temp = ac - 1
	inclass[nums[i]] = (ac, cnt)
	j = i - 1
	while ac_temp > 0:
		inclass[nums[j]] = (ac, cnt)
		j -= 1
		ac_temp -= 1
	ac = 1
	ans = 0
	for key in inclass:
		ans = max(ans, inclass[key][0])
	for i in range(1, len(nums) - 1):
		if nums[i - 1] < nums[i + 1] and inclass[nums[i - 1]][1] != inclass[nums[i + 1]][1]:
			ans = max(ans, inclass[nums[i - 1]][0] + inclass[nums[i + 1]][0] - 1)
	print(ans)
main()


import sys
N = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
list_check = [1] * N
list_check.append(0)
list_r = [1 for _ in range(N)]
for i in range(1, N):
	if a[i] > a[i - 1]:
		list_check[i] += list_check[i - 1]
list_check_r = list_check[:]
(s, e) = (0, 1)
while s <= e and e < N:
	if list_check[e] < list_check[e + 1]:
		e += 1
	elif list_check[e] > list_check[e + 1]:
		for i in range((e - s + 1) // 2):
			list_check_r[i + s] = list_check[e - i]
			list_check_r[e - i] = list_check[i + s]
		s = e + 1
		e += 1
	else:
		e += 1
		s += 1
res = 0
for i in range(N):
	res = max(res, list_check[i])
	if 0 < i < N - 1:
		if a[i - 1] < a[i + 1]:
			res = max(res, list_check[i - 1] + list_check_r[i + 1])
print(res)


n = int(input())
ar = list(map(int, input().split()))
l = [1] * n
r = [1] * n
ans = 0
for i in range(n - 1):
	if ar[i] < ar[i + 1]:
		l[i + 1] = l[i] + 1
for j in range(n - 1, 0, -1):
	if ar[j] > ar[j - 1]:
		r[j - 1] = r[j] + 1
for k in range(n - 2):
	if ar[k] < ar[k + 2]:
		ans = max(ans, l[k] + r[k + 2])
for m in range(n):
	ans = max(ans, l[m])
print(ans)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
A = LIST()
B = [1] * N
for (i, a) in enumerate(A[1:], 1):
	if A[i - 1] < a:
		B[i] = B[i - 1] + 1
B2 = [1] * N
for i in range(N - 2, -1, -1):
	if A[i] < A[i + 1]:
		B2[i] = B2[i + 1] + 1
ans = max(B)
for i in range(1, N - 1):
	if A[i - 1] < A[i + 1]:
		ans = max(ans, B[i - 1] + B2[i + 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
curr = [a[0]]
all = []
ans = 0
for i in range(1, n):
	if a[i - 1] < a[i]:
		curr.append(a[i])
	else:
		all.append(curr)
		ans = max(ans, len(curr))
		curr = [a[i]]
ans = max(ans, len(curr))
all.append(curr)
for i in range(1, len(all)):
	if len(all[i]) > 1 and len(all[i - 1]) > 1:
		if all[i - 1][-1] < all[i][1]:
			ans = max(ans, len(all[i - 1]) + len(all[i]) - 1)
		if all[i - 1][-2] < all[i][0]:
			ans = max(ans, len(all[i - 1]) + len(all[i]) - 1)
print(ans)


n = int(input())
a = list(map(int, input().split()))
f1 = [1 for i in range(n)]
f2 = [1 for i in range(n)]
for i in range(1, n):
	if a[i - 1] < a[i]:
		f1[i] = f1[i - 1] + 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		f2[i] = f2[i + 1] + 1
l = max(f1)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1] and f1[i - 1] + f2[i + 1] > l:
		l = f1[i - 1] + f2[i + 1]
print(l)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
n = read_int()
a = read_int_line()
dp = [1] * n
for i in range(1, n):
	if a[i] > a[i - 1]:
		dp[i] += dp[i - 1]
dp2 = [1] * n
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		dp2[i] += dp2[i + 1]
mxm = max(dp)
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		mxm = max(mxm, dp[i - 1] + dp2[i + 1])
print(mxm)


n = int(input())
A = list(map(int, input().split()))
ans = 0
suf = [1] * n
pre = [1] * n
for i in range(n - 2, -1, -1):
	if A[i] < A[i + 1]:
		suf[i] = suf[i + 1] + 1
	ans = max(suf[i], ans)
for i in range(1, n):
	if A[i] > A[i - 1]:
		pre[i] = pre[i - 1] + 1
	ans = max(pre[i], ans)
for i in range(1, n - 2):
	if A[i] < A[i + 2]:
		ans = max(ans, suf[i + 2] + pre[i])
print(ans)


def solve(arr, n):
	if n == 1:
		return 1
	if n == 2:
		if arr[1] > arr[0]:
			return 2
		else:
			return 1
	dp = list()
	org = list()
	curr = 1
	org.append(1)
	for i in range(1, n):
		if arr[i] > arr[i - 1]:
			curr += 1
			org.append(curr)
		else:
			curr = 1
			org.append(curr)
	dp.append(org[0])
	dp.append(org[1])
	for i in range(2, n):
		if arr[i] > arr[i - 2]:
			if arr[i] > arr[i - 1]:
				dp.append(max(dp[i - 1] + 1, org[i - 2] + 1))
			else:
				dp.append(max(org[i], org[i - 2] + 1))
		elif arr[i] > arr[i - 1]:
			dp.append(dp[i - 1] + 1)
		else:
			dp.append(org[i])
	return max(dp)
n = int(input())
arr = list(map(int, input().split()))
print(solve(arr, n))


n = int(input())
a = list(map(int, input().split()))
ans = 1
rg = [1] * n
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		rg[i] = rg[i + 1] + 1
		ans = max(ans, rg[i])
lf = [1] * n
for i in range(1, n):
	if a[i - 1] < a[i]:
		lf[i] = lf[i - 1] + 1
	ans = max(ans, lf[i])
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, lf[i] + rg[i + 2])
print(ans)


input()
n = map(int, input().split())
n = list(n)
f = 1
if n[1] > n[0]:
	c = 2
	d = 2
	MAX = 2
else:
	c = 1
	d = 1
	MAX = 1
for (i, x) in enumerate(n[2:]):
	i += 2
	if x > n[i - 1]:
		a = c + 1
		b = d + 1
		if x > n[i - 2]:
			b = max(b, 1 + f)
	else:
		a = 1
		if x > n[i - 2]:
			b = 1 + f
		else:
			b = 1
	MAX = max(MAX, a, b)
	f = c
	c = a
	d = b
print(MAX)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		n = ri()
		a = ria()
		zaa = a.copy()
		a = [0] + a + [0]
		strincsubarrays = []
		top = []
		s = 0
		for i in range(1, n + 2):
			if a[i] - a[i - 1] <= 0:
				strincsubarrays.append(s)
				s = 1
			else:
				s += 1
		ans = max(strincsubarrays)
		na = []
		c = 0
		for i in strincsubarrays:
			c += 1
			na += [[i, c]] * i
		for i in range(1, n - 1):
			if zaa[i - 1] < zaa[i + 1] and na[i + 1][1] != na[i - 1][1]:
				k = na[i + 1][0] - 1 + na[i - 1][0]
				if k > ans:
					ans = k
		print(ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


N = int(input())
l = list(map(int, input().split()))
nor = [1] * N
rev = [1] * N
for i in range(1, N):
	if l[i] > l[i - 1]:
		nor[i] += nor[i - 1]
for i in range(N - 2, -1, -1):
	if l[i] < l[i + 1]:
		rev[i] += rev[i + 1]
m = max(nor)
for i in range(N - 3, -1, -1):
	if l[i] < l[i + 2]:
		m = max(m, nor[i] + rev[i + 2])
print(m)


n = int(input())
a = list(map(int, input().split()))
inc_seq = []
last = 0
for i in range(len(a)):
	if i == 0 or a[i] > a[i - 1]:
		continue
	else:
		inc_seq.append((last, i - 1, a[i - 1]))
		last = i
inc_seq.append((last, len(a) - 1, a[-1]))
maxList = list(map(lambda x: x[1] - x[0] + 1, inc_seq))
i = 0
j = 1
while j < len(inc_seq):
	try:
		if inc_seq[i][1] + 1 == inc_seq[j][0] and a[inc_seq[i][1] - 1] < a[inc_seq[j][0]]:
			maxList.append(inc_seq[j][1] - inc_seq[i][0])
		elif inc_seq[i][1] + 1 == inc_seq[j][0] and a[inc_seq[i][1]] < a[inc_seq[j][0] + 1]:
			maxList.append(inc_seq[j][1] - inc_seq[i][0])
	except:
		pass
	i += 1
	j += 1
print(max(maxList))


n = int(input())
a = list(map(int, input().split()))
dp1 = [0 for i in range(n + 1)]
dp2 = [0 for i in range(n + 1)]
dp1[1] = 1
for i in range(2, n + 1):
	if a[i - 1] > a[i - 2]:
		dp1[i] = dp1[i - 1] + 1
	else:
		dp1[i] = 1
dp2[n] = 1
for i in range(n - 1, 0, -1):
	if a[i - 1] < a[i]:
		dp2[i] = dp2[i + 1] + 1
	else:
		dp2[i] = 1
ans = 0
for i in range(2, n):
	if a[i] > a[i - 2]:
		ans = max(ans, dp1[i - 1] + dp2[i + 1])
for i in range(1, n + 1):
	ans = max(ans, dp1[i], dp2[i])
print(ans)


import sys
import math
n = int(input())
a = list(map(int, sys.stdin.readline().split()))
newA = []
arr = [a[0]]
ans = 0
for i in range(1, len(a)):
	if a[i] > a[i - 1]:
		arr.append(a[i])
	else:
		newA.append(arr)
		arr = [a[i]]
if len(arr):
	newA.append(arr)
for i in range(len(newA)):
	ans = max(ans, len(newA[i]))
for i in range(1, len(newA)):
	if len(newA[i]) > 1 and newA[i - 1][-1] < newA[i][1]:
		ans = max(len(newA[i]) + len(newA[i - 1]) - 1, ans)
	if len(newA[i - 1]) > 1 and newA[i - 1][-2] < newA[i][0]:
		ans = max(len(newA[i]) + len(newA[i - 1]) - 1, ans)
print(ans)


n = int(input())
l = list(map(int, input().split()))
sufinc = [1] * n
count = 1
for i in range(n - 2, -1, -1):
	if l[i] < l[i + 1]:
		count += 1
		sufinc[i] = count
	else:
		count = 1
		sufinc[i] = count
preinc = [1] * n
count = 1
for i in range(1, n):
	if l[i] > l[i - 1]:
		count += 1
		preinc[i] = count
	else:
		count = 1
		preinc[i] = count
ans = 0
ans = max(sufinc[0], preinc[-1])
ans = max(sufinc[1], preinc[-2], ans)
for i in range(1, n - 1):
	if l[i + 1] > l[i - 1]:
		if preinc[i - 1] + sufinc[i + 1] > ans:
			ans = preinc[i - 1] + sufinc[i + 1]
	else:
		ans = max(ans, preinc[i - 1], sufinc[i + 1])
print(ans)


n = int(input())
mx = 1
a = input().split()
for i in range(n):
	a[i] = int(a[i])
pre = [0] * n
suf = [0] * n
pre[0] = 1
for i in range(1, n):
	if a[i] > a[i - 1]:
		pre[i] = pre[i - 1] + 1
	else:
		pre[i] = 1
	mx = max(mx, pre[i])
suf[n - 1] = 1
for i in range(n - 2, -1, -1):
	if a[i] < a[i + 1]:
		suf[i] = suf[i + 1] + 1
	else:
		suf[i] = 1
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		mx = max(mx, pre[i - 1] + suf[i + 1])
print(mx)


n = int(input())
a = [1e+18] + [int(i) for i in input().split()] + [-1]
(l, r) = ([0] * (n + 1), [0] * (n + 1))
cnt = 0
for i in range(1, n + 1):
	if a[i] <= a[i - 1]:
		cnt = 0
	cnt += 1
	l[i] = cnt
for i in reversed(range(1, n + 1)):
	if a[i] >= a[i + 1]:
		cnt = 0
	cnt += 1
	r[i] = cnt
ans = max(l)
for i in range(1, n + 1):
	if a[i - 1] < a[i + 1]:
		ans = max(ans, l[i - 1] + r[i + 1])
print(ans)


n = int(input())
a = [int(i) for i in input().split()]
left = [0 for _ in range(n)]
right = [0 for _ in range(n)]
for i in range(n):
	val = 0
	if i - 1 >= 0 and a[i - 1] < a[i]:
		val = max(val, left[i - 1])
	left[i] = 1 + val
for i in range(n - 1, -1, -1):
	val = 0
	if i + 1 < n and a[i] < a[i + 1]:
		val = max(val, right[i + 1])
	right[i] = 1 + val
val = 0
for i in range(1, n - 1):
	if a[i - 1] < a[i + 1]:
		val = max(val, left[i - 1] + right[i + 1])
for i in range(n):
	val = max(val, left[i])
print(val)


ii = lambda : int(input())
kk = lambda : map(int, input().split())
ll = lambda : list(kk())
n = ii()
ls = ll()
(l, r) = ([1] * n, [1] * n)
m = 0
for i in range(1, n):
	if ls[i] > ls[i - 1]:
		l[i] = l[i - 1] + 1
for i in range(n - 2, -1, -1):
	if ls[i] < ls[i + 1]:
		r[i] = r[i + 1] + 1
for i in range(1, n - 1):
	if ls[i - 1] < ls[i + 1]:
		m = max(m, l[i - 1] + r[i + 1])
	m = max(m, l[i], r[i])
m = max(m, r[0], r[n - 1], l[0], l[n - 1])
print(m)


n = int(input())
arr = [int(x) for x in input().split()]
ending = [1]
starting = [1]
for x in range(1, n):
	if arr[x] > arr[x - 1]:
		ending.append(ending[-1] + 1)
	else:
		ending.append(1)
for x in range(n - 2, -1, -1):
	if arr[x] < arr[x + 1]:
		starting.append(starting[-1] + 1)
	else:
		starting.append(1)
starting = starting[::-1]
ans = max(ending)
for x in range(1, n - 1):
	if arr[x + 1] > arr[x - 1]:
		ans = max(ans, ending[x - 1] + starting[x + 1])
print(ans)


q = int(input())
a = list(map(int, input().split()))
path = [1]
start = [0]
end = [0]
max_len = [1]
for i in range(1, len(a)):
	if a[i] > a[i - 1]:
		path.append(path[-1] + 1)
		max_len[-1] += 1
	else:
		path.append(1)
		start.append(i)
		max_len.append(1)
ans = max(max_len)
for i in range(len(start) - 1):
	if start[i] + max_len[i] - 2 >= 0 and max_len[i + 1] > 1:
		if a[start[i] + max_len[i] - 2] < a[start[i + 1]]:
			ans = max(ans, max_len[i] + max_len[i + 1] - 1)
		elif a[start[i] + max_len[i] - 1] < a[start[i + 1] + 1]:
			ans = max(ans, max_len[i] + max_len[i + 1] - 1)
print(ans)


n = int(input())
seq = list(map(int, input().split()))
best = [None] * n
best[0] = (1, 0)
for i in range(1, n):
	if seq[i] > seq[i - 1]:
		(a, b) = (best[i - 1][0] + 1, best[i - 1][1] + 1)
		if i >= 2 and seq[i] > seq[i - 2]:
			b = max(b, best[i - 2][0] + 1)
		best[i] = (a, b)
	else:
		(a, b) = (1, 0)
		if i >= 2 and seq[i] > seq[i - 2]:
			b = max(b, best[i - 2][0] + 1)
		best[i] = (a, b)
maxes = [max(i) for i in best]
print(max(maxes))


import sys, math

def input():
	return sys.stdin.readline()[:-1]

def main():
	n = int(input())
	a = list(map(int, input().split()))
	dp = [[0, 0] for k in range(n + 1)]
	dp[0][0] = 1
	for k in range(1, n):
		if a[k - 1] < a[k]:
			dp[k][0] = dp[k - 1][0] + 1
		else:
			dp[k][0] = 1
	for k in range(2, n):
		if a[k - 1] < a[k]:
			dp[k][1] = dp[k - 1][1] + 1
		if a[k - 2] < a[k]:
			dp[k][1] = max(dp[k][1], dp[k - 2][0] + 1)
	ans = 0
	for e in dp:
		ans = max(ans, max(e))
	print(ans)
main()


from typing import List

def first_calculation(array: List[int]):
	dp: List[int] = [1] * len(array)
	par: List[int] = [i for i in range(0, len(array))]
	for i in range(1, len(array)):
		if array[i] > array[i - 1]:
			dp[i] = dp[i - 1] + 1
			par[i] = par[i - 1]
		else:
			for j in range(par[i - 1], i):
				par[j] = i - 1
	for i in range(par[-1], len(array)):
		par[i] = len(array) - 1
	return (dp, par)

def with_removing(array: List[int], dp: List[int], par: List[int]):
	max_ret = 0
	for i in range(1, len(array) - 1):
		if par[i + 1] != par[i - 1] and array[i + 1] > array[i - 1]:
			if array[i] > array[i + 1]:
				max_ret = max(max_ret, dp[i - 1] + dp[par[i + 1]])
			else:
				max_ret = max(max_ret, dp[i - 1] + dp[par[i + 1]] - 1)
	return max_ret

def solution(array: List[int]):
	(dp, par) = first_calculation(array)
	removed_element = with_removing(array, dp, par)
	return max(max(dp), removed_element)
_ = int(input())
array = list(map(int, input().split()))
print(solution(array))


import time
import string
LOCAL = False
start_time = None
if LOCAL:
	start_time = time.time()
n = int(input())
a = list(map(lambda x: int(x), input().split(' ')))
z = []
prev = a[0]
current = [0, 0]
maxl = -1
for (uka, i) in enumerate(a[1:]):
	if prev < i:
		current[1] = uka + 1
	else:
		z.append(current)
		maxl = max(current[1] - current[0] + 1, maxl)
		current = [uka + 1, uka + 1]
	prev = i
maxl = max(current[1] - current[0] + 1, maxl)
z.append(current)
if len(z) == 1:
	print(maxl)
else:
	for (i, mas) in enumerate(z[:-1]):
		next_max = z[i + 1]
		le = mas[0]
		r = next_max[0]
		if mas[1] == mas[0] or next_max[1] == next_max[0]:
			continue
		if a[mas[1] - 1] < a[r] or a[r + 1] > a[mas[1]]:
			maxl = max(maxl, next_max[1] - le)
	print(maxl)
if LOCAL:
	print('--- %s seconds ---' % (time.time() - start_time))


n = int(input())
a = [1e+20] + list(map(int, input().split())) + [0]
b = [0] * (n + 2)
x = 0
for i in range(1, n + 1):
	if a[i] > a[i - 1]:
		x += 1
	else:
		x = 1
	b[i] = x
x = 0
c = max(b)
for i in range(n, 0, -1):
	if a[i - 1] < a[i + 1]:
		c = max(c, b[i - 1] + x)
	if a[i] < a[i + 1]:
		x += 1
	else:
		x = 1
print(c)


n = int(input())
maxx = 1
ch = input()
nb = 1
nb2 = 1
L = [int(i) for i in ch.split()]
L2 = []
L3 = []
test = False
for i in range(n - 2):
	if L[i] < L[i + 1]:
		nb += 1
	else:
		L2.append(nb)
		nb = 1
		if L[i - 1] >= L[i + 1] and L[i] >= L[i + 2]:
			L3.append(False)
		else:
			L3.append(True)
if L[n - 2] < L[n - 1]:
	nb += 1
L2.append(nb)
L4 = []
if len(L3) > 0:
	for i in range(len(L3)):
		if L3[i] == True:
			L4.append(L2[i] + L2[i + 1] - 1)
		else:
			L4.append(L2[i])
			L4.append(L2[i + 1])
	print(max(L4))
else:
	print(L2[0])


n = int(input())
a = list(map(int, input().split()))
dp = [0 for _ in range(n)]
for i in range(n - 1, -1, -1):
	if i == n - 1 or a[i] >= a[i + 1]:
		dp[i] = 1
	else:
		dp[i] = dp[i + 1] + 1
ans = l = 1
i = 0
for j in range(1, n):
	if a[j] > a[j - 1]:
		l += 1
	else:
		if j - 2 >= i:
			if a[j] > a[j - 2]:
				ans = max(ans, dp[j] + l - 1)
			if j + 1 < n and a[j - 1] < a[j + 1]:
				ans = max(ans, dp[j + 1] + l)
		l = 1
		i = j
	ans = max(ans, l)
print(ans)


import sys

class Input:
	stdin_input = []

	def get_next_token(self):
		if not self.stdin_input or len(self.stdin_input) == 0:
			self.stdin_input = sys.stdin.readline().split(' ')
		result = self.stdin_input[0]
		self.stdin_input = self.stdin_input[1:]
		return result

	def get_next_line(self):
		return sys.stdin.readline()

	def read_str(self):
		return self.get_next_token()

	def read_int(self):
		return int(self.get_next_token())
read = Input()
size = read.read_int()
left = [1] * size
right = [1] * size
stdin_input = sys.stdin.readline().split(' ')
t = list(map(lambda a: int(a), stdin_input))
res = 1
for i in range(1, size):
	if t[i - 1] < t[i]:
		left[i] = left[i - 1] + 1
for i in range(size - 2, -1, -1):
	if t[i] < t[i + 1]:
		right[i] = right[i + 1] + 1
for i in range(0, size - 2):
	if t[i] < t[i + 2]:
		res = max(res, left[i] + right[i + 2])
for i in range(0, size - 1):
	if t[i] < t[i + 1]:
		res = max(res, left[i] + right[i + 1])
print(res)


n = int(input())
a = [int(i) for i in input().split()]
d = []
actual = [a[0]]
for i in range(1, n):
	if a[i] > a[i - 1]:
		actual.append(a[i])
	else:
		d.append([len(actual), actual])
		actual = [a[i]]
d.append([len(actual), actual])
maxi = 0
if len(d) == 1:
	print(n)
else:
	n = len(d)
	for i in range(n):
		maxi = max(maxi, d[i][0])
	for i in range(n - 1):
		if d[i][0] > 1 and d[i + 1][0] > 1:
			if d[i][1][-2] < d[i + 1][1][0] or d[i][1][-1] < d[i + 1][1][1]:
				maxi = max(maxi, d[i][0] + d[i + 1][0] - 1)
	for i in range(n - 2):
		if d[i + 1][0] == 1:
			if d[i][1][-1] < d[i + 2][1][0]:
				maxi = max(maxi, d[i][0] + d[i + 2][0])
	print(maxi)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
lr = [0] * n
lr[-1] = 1
for i in range(n - 1)[::-1]:
	if a[i] < a[i + 1]:
		lr[i] = lr[i + 1] + 1
	else:
		lr[i] = 1
rl = [0] * n
rl[0] = 1
for i in range(n - 1):
	if a[i] < a[i + 1]:
		rl[i + 1] = rl[i] + 1
	else:
		rl[i + 1] = 1
ans = max(max(lr), max(rl))
for i in range(1, n - 1):
	left = rl[i - 1]
	right = lr[i + 1]
	if a[i - 1] < a[i + 1]:
		ans = max(left + right, ans)
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
dp = [1]
for i in range(1, n):
	if a[i - 1] < a[i]:
		dp.append(dp[i - 1] + 1)
	else:
		dp.append(1)
dp2 = [1] * n
for i in range(n - 2, -1, -1):
	if a[i + 1] > a[i]:
		dp2[i] = dp2[i + 1] + 1
ans = max(dp)
for i in range(n - 2):
	if a[i] < a[i + 2]:
		ans = max(ans, dp[i] + dp2[i + 2])
print(ans)


import os
import sys
import bisect
from math import gcd, ceil
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline().decode('ascii')

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
data = [int(i) for i in input().split()]
l = [1]
idx = [0]
for i in range(1, len(data)):
	if data[i] > data[i - 1]:
		l[-1] += 1
	else:
		l.append(1)
		idx.append(i)
max_length = 0
for i in range(1, len(idx)):
	index = idx[i]
	if l[i] > 1 and (data[index - 2] < data[index] or data[index - 1] < data[index + 1]):
		max_length = max(max_length, l[i] + l[i - 1] - 1)
print(max(max(l), max_length))


n = int(input())
a = list(map(int, input().split()))
subarray = []
cur_length = 1
for i in range(n - 1):
	if a[i] < a[i + 1]:
		cur_length += 1
	else:
		subarray.append(cur_length)
		cur_length = 1
subarray.append(cur_length)
result = max(subarray)
index_acc = 0
for i in range(len(subarray) - 1):
	index_acc += subarray[i]
	if subarray[i] >= 2 and subarray[i + 1] >= 2:
		leftmost = index_acc - 2
		rightmost = index_acc + 1
		if a[leftmost] < a[rightmost - 1] or a[leftmost + 1] < a[rightmost]:
			result = max(result, subarray[i] + subarray[i + 1] - 1)
print(result)


n = int(input())
a = list(map(int, input().split()))
l = []
c = 0
c1 = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		c1 += 1
	else:
		l.append([c, c1])
		c = c1 + 1
		c1 += 1
l.append([c, c1])
m = 1
for i in l:
	m = max(m, i[1] - i[0] + 1)
for i in range(1, len(l)):
	if l[i][0] != l[i][1] and l[i - 1][0] != l[i - 1][1]:
		if a[l[i - 1][1] - 1] < a[l[i][0]]:
			m = max(m, l[i - 1][1] - l[i - 1][0] + l[i][1] - l[i][0] + 1)
		elif a[l[i][0] + 1] > a[l[i - 1][1]]:
			m = max(m, l[i - 1][1] - l[i - 1][0] + l[i][1] - l[i][0] + 1)
print(m)


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


n = int(input())
arr = list(map(int, input().split()))
dec = [1 for i in range(n)]
inc = [1 for i in range(n)]
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		dec[i] = dec[i - 1] + 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		inc[i] = inc[i + 1] + 1
m = max(max(inc), max(dec))
for i in range(1, n - 1):
	if arr[i - 1] < arr[i + 1]:
		m = max(m, dec[i - 1] + inc[i + 1])
print(m)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
dpl = [1]
dpr = [1]
for i in range(1, n):
	if l[i - 1] < l[i]:
		dpl.append(dpl[-1] + 1)
	else:
		dpl.append(1)
for i in range(n - 2, -1, -1):
	if l[i + 1] > l[i]:
		dpr.append(dpr[-1] + 1)
	else:
		dpr.append(1)
an = max(dpl)
dpr = dpr[::-1]
for i in range(1, n - 1):
	if l[i - 1] < l[i + 1]:
		an = max(an, dpl[i - 1] + dpr[i + 1])
print(an)


n = int(input())
b = [0]
a = list(map(int, input().split()))
a = b + a
a1 = [0] * (n + 1)
a2 = [0] * (n + 1)
a1[1] = 1
for i in range(2, n + 1):
	if a[i] > a[i - 1]:
		a1[i] = a1[i - 1] + 1
		a2[i] = a2[i - 1] + 1
	else:
		a1[i] = 1
	if a[i] > a[i - 2]:
		a2[i] = max(a2[i], a1[i - 2] + 1)
print(max(max(a1), max(a2)))


n = int(input())
a = list(map(int, input().split()))
b = []
now = []
prev = 0
ans = 0
for i in range(n):
	if prev < a[i]:
		now.append(a[i])
	else:
		b.append(now)
		ans = max(ans, len(now))
		now = [a[i]]
	prev = a[i]
if len(now) != 0:
	ans = max(ans, len(now))
	b.append(now)
for i in range(1, len(b)):
	if len(b[i - 1]) >= 2:
		if b[i - 1][-2] < b[i][0]:
			ans = max(ans, len(b[i]) + len(b[i - 1]) - 1)
	if len(b[i]) >= 2:
		if b[i][1] > b[i - 1][-1]:
			ans = max(ans, len(b[i]) + len(b[i - 1]) - 1)
print(ans)


n = int(input())
lst = list(map(int, input().split()))
dp1 = [1] * n
dp2 = [1] * n
maxx = 1
for i in range(1, n):
	if lst[i] > lst[i - 1]:
		dp1[i] = dp1[i - 1] + 1
		dp2[i] = dp2[i - 1] + 1
	else:
		pass
	if i > 1 and lst[i] > lst[i - 2]:
		dp2[i] = max(dp1[i - 2] + 1, dp2[i])
	else:
		pass
	maxx = max(maxx, dp2[i], dp1[i])
print(maxx)


n = int(input())
arr = list(map(int, input().split()))
l = [1 for i in range(n)]
r = [1 for i in range(n)]
for i in range(1, n):
	if arr[i] > arr[i - 1]:
		l[i] = l[i - 1] + 1
	else:
		l[i] = 1
for i in range(n - 2, -1, -1):
	if arr[i] < arr[i + 1]:
		r[i] = r[i + 1] + 1
	else:
		r[i] = 1
count = max(l)
for i in range(n):
	if i == 0:
		leng = r[i + 1]
		if leng > count:
			count = leng
	elif i == n - 1:
		leng = l[i - 1]
		if leng > count:
			count = leng
	elif arr[i - 1] < arr[i + 1]:
		leng = l[i - 1] + r[i + 1]
		if leng > count:
			count = leng
print(count)


n = int(input())
L = list(map(int, input().split()))
dp = [1] * n
cnt = [1] * n
(dp[1], cnt[1]) = (2, 2) if L[1] > L[0] else (1, 1)
for idx in range(2, len(L)):
	cnt[idx] = cnt[idx - 1] + 1 if L[idx] > L[idx - 1] else 1
for idx in range(2, len(L)):
	dp[idx] = max(dp[idx - 1] + 1 if L[idx] > L[idx - 1] else 1, cnt[idx - 2] + 1 if L[idx] > L[idx - 2] else 1)
print(max(dp))


n = int(input())
t = list(map(int, input().split()))
pre = [1] * n
back = [1] * n
for i in range(1, n):
	if t[i] > t[i - 1]:
		pre[i] = pre[i - 1] + 1
for i in range(n - 2, -1, -1):
	if t[i] < t[i + 1]:
		back[i] = back[i + 1] + 1
ans = 0
for i in range(n):
	ans = max(ans, pre[i], back[i])
	if i == 0:
		ans = max(ans, back[i])
	elif i == n - 1:
		ans = max(ans, pre[i])
	elif t[i + 1] > t[i - 1]:
		ans = max(ans, pre[i - 1] + back[i + 1])
print(ans)


def max_length(length, arr):
	sub_arr_1 = [1] * length
	sub_arr_2 = [1] * length
	for j in range(length - 2, -1, -1):
		if arr[j] < arr[j + 1]:
			sub_arr_1[j] = sub_arr_1[j + 1] + 1
			sub_arr_2[j] = sub_arr_2[j + 1] + 1
		if j + 2 < length and arr[j] < arr[j + 2]:
			sub_arr_2[j] = max(sub_arr_2[j], sub_arr_1[j + 2] + 1)
	max_1 = max(sub_arr_1)
	max_2 = max(sub_arr_2)
	return max(max_1, max_2)
n = int(input(''))
second_line = input('')
a = second_line.split()
for i in range(0, n):
	a[i] = int(a[i])
print(max_length(n, a))


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
array = read_int_array()
count = 2 if array[0] < array[1] else 1
prevcount = 1
delcount = 0
maxcount = count
for i in range(2, n):
	if array[i - 1] < array[i]:
		if delcount == 0 and array[i - 2] < array[i]:
			delcount = prevcount + 1
		else:
			delcount += 1
		prevcount = count
		count += 1
	else:
		delcount = prevcount + 1 if array[i - 2] < array[i] else 0
		prevcount = count
		count = 1
	maxcount = max(maxcount, count, delcount)
print(maxcount)


n = int(input())
line = input().split(' ')
A = []
for e in line:
	A.append(int(e))
ans = 1
left = [1] * n
right = [1] * n
for i in range(1, n):
	if A[i] > A[i - 1]:
		left[i] = 1 + left[i - 1]
	if A[n - 1 - i] < A[n - i]:
		right[n - 1 - i] = 1 + right[n - i]
ans = 1
for i in range(n):
	ans = max(ans, left[i])
	ans = max(ans, right[i])
	if i > 0 and i < n - 1 and (A[i - 1] < A[i + 1]):
		ans = max(ans, left[i - 1] + right[i + 1])
print(ans)


import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
pre = -1
P = []
tmp = 0
for (i, a) in enumerate(A):
	if a > pre:
		P.append(tmp)
	else:
		tmp = i
		P.append(i)
	pre = a
Q = [-1] * N
tmp = N - 1
pre = N - 1
for i in reversed(range(N)):
	a = A[i]
	if a < pre:
		Q[i] = tmp
	else:
		tmp = i
		Q[i] = tmp
	pre = a
ans = max(Q[0] + 1, N - P[N - 1])
for i in range(1, N - 1):
	ans = max(ans, Q[i] - P[i] + 1)
	if A[i - 1] < A[i + 1]:
		ans = max(ans, Q[i + 1] - P[i - 1])
print(ans)


n = int(input())
a = list(map(int, input().split()))
d = [0] * n
d[0] = 1
seg = []
for i in range(1, n):
	if a[i] > a[i - 1]:
		d[i] = d[i - 1] + 1
	else:
		d[i] = 1
		seg.append((d[i - 1], i - 1))
seg.append((d[n - 1], n - 1))
max_dist = seg[0][0]
for i in range(1, len(seg)):
	(dist_old, ind_old) = seg[i - 1]
	(dist_new, ind_new) = seg[i]
	if ind_old - 1 >= 0 and a[ind_old - 1] < a[ind_old + 1] or (ind_old + 2 <= n - 1 and a[ind_old] < a[ind_old + 2]):
		max_dist = max(max_dist, dist_old + dist_new - 1)
	max_dist = max(max_dist, dist_new)
print(max_dist)


n = int(input())
els = list(map(int, input().strip().split()))
dp = [[0] * len(els) for _ in range(2)]
dp[0][0] = 1
dp[1][0] = 1
for i in range(1, len(els)):
	if els[i] > els[i - 1]:
		dp[0][i] = 1 + dp[0][i - 1]
	else:
		dp[0][i] = 1
for i in range(1, len(els)):
	if els[i] > els[i - 1]:
		prvi = dp[1][i - 1] + 1
	else:
		prvi = 1
	if i >= 2 and els[i] > els[i - 2]:
		drugi = 1 + dp[0][i - 2]
	else:
		drugi = 1
	dp[1][i] = max(prvi, drugi)
print(max(max(dp)))


import string

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	lo = [1] * (n + 1)
	hi = [1] * (n + 1)
	prev = 1
	for i in range(1, n):
		if l[i] > l[i - 1]:
			lo[i] = lo[i - 1] + 1
	l.reverse()
	for i in range(1, n):
		if l[i] < l[i - 1]:
			hi[n - i - 1] = hi[n - i] + 1
	l.reverse()
	ans = 1
	for i in range(n):
		if lo[i] > ans:
			ans = lo[i]
	for i in range(1, n - 1):
		if lo[i - 1] + hi[i + 1] > ans and l[i + 1] > l[i - 1]:
			ans = lo[i - 1] + hi[i + 1]
	print(ans)
t = 1
while t > 0:
	solve()
	t -= 1