#include <bits/stdc++.h>
using namespace std;
long long int dfs(vector<long long int>* v, long long int n) {
  long long int i, j, k, max = 0, temp;
  if (v[n].size() == 0) return 1;
  for (i = 0; i < v[n].size(); i++) {
    temp = 1 + dfs(v, v[n][i]);
    if (temp > max) max = temp;
  }
  return max;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, i, j, k, arr[100005] = {0}, arr1[100005] = {0}, par = 0,
                            temp = 0, buff = 0, maxi = 2, rem = 0, strt = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  for (i = 0; i < n; i++) arr1[i] = arr[i];
  strt = 0;
  if (n == 1) {
    cout << "1";
    return 0;
  }
  for (i = 1; i < n; i++) {
    if (arr[i] <= arr[i - 1]) {
      if (!par) {
        par = 1;
        rem = i;
        buff = arr[i];
        arr[i] = arr[i - 1] + 1;
      } else {
        par = 0;
        if (maxi < (i - strt)) maxi = i - strt;
        strt = rem;
        arr[rem] = buff;
        i--;
      }
    }
  }
  if (maxi < (i - strt)) maxi = i - strt;
  strt = n - 1;
  rem = 0;
  buff = 0;
  temp = 0;
  par = 0;
  for (i = n - 2; i >= 0; i--) {
    if (arr1[i] >= arr1[i + 1]) {
      if (!par) {
        par = 1;
        rem = i;
        buff = arr1[i];
        arr1[i] = arr1[i + 1] - 1;
      } else {
        par = 0;
        if (maxi < abs(i - strt)) maxi = abs(i - strt);
        strt = rem;
        arr1[rem] = buff;
        i++;
      }
    }
  }
  if (maxi < abs(i - strt)) maxi = abs(i - strt);
  cout << maxi;
  return 0;
}
