Codeforces Round #FF (Div. 1) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

dp

implementation

two pointers

*1600

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. DZY Loves Sequences

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputDZY has a sequence *a*, consisting of *n* integers.

We'll call a sequence *a*_{i}, *a*_{i + 1}, ..., *a*_{j} (1 ≤ *i* ≤ *j* ≤ *n*) a subsegment of the sequence *a*. The value (*j* - *i* + 1) denotes the length of the subsegment.

Your task is to find the longest subsegment of *a*, such that it is possible to change at most one number (change one number to any integer you want) from the subsegment to make the subsegment strictly increasing.

You only need to output the length of the subsegment you find.

Input

The first line contains integer *n* (1 ≤ *n* ≤ 10^{5}). The next line contains *n* integers *a*_{1}, *a*_{2}, ..., *a*_{n} (1 ≤ *a*_{i} ≤ 10^{9}).

Output

In a single line print the answer to the problem — the maximum length of the required subsegment.

Examples

Input

6

7 2 3 1 5 6

Output

5

Note

You can choose subsegment *a*_{2}, *a*_{3}, *a*_{4}, *a*_{5}, *a*_{6} and change its 3rd element (that is *a*_{4}) to 4.

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/29/2023 04:54:43 (k1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|