#include <bits/stdc++.h>
using namespace std;
long long int a[100001];
long long int vstart[100001], vend[100001];
int main() {
  long long int t, i, j, n;
  long long int temp;
  long long int start, end, start_max, end_max;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  start = 1;
  end = 1;
  start_max = 1;
  end_max = 1;
  j = 0;
  for (i = 2; i <= n; i++) {
    if (a[i] > a[i - 1]) {
      end = i;
    } else {
      if (end - start + 1 > end_max - start_max + 1) {
        start_max = start;
        end_max = end;
      }
      vstart[j] = start;
      vend[j] = end;
      j++;
      start = i;
      end = i;
    }
  }
  if (end - start + 1 > end_max - start_max + 1) {
    start_max = start;
    end_max = end;
  }
  vstart[j] = start;
  vend[j] = end;
  j++;
  int g = 0;
  for (i = 0; i < j; i++) {
    if (binary_search(vstart, vstart + j, vend[i] + 1)) {
      temp = lower_bound(vstart, vstart + j, vend[i] + 1) - vstart;
      if (vend[temp] - vstart[temp] != 0) {
        if (a[vend[i]] + 1 < a[vstart[temp] + 1]) {
          if (vend[temp] - vstart[i] + 1 > end_max - start_max + 1) {
            g = 1;
            start_max = vstart[i];
            end_max = vend[temp];
          }
        } else {
          if (vend[i] - vstart[i] != 0) {
            if (a[vstart[temp]] - 1 > a[vend[i] - 1]) {
              if (vend[temp] - vstart[i] + 1 > end_max - start_max + 1) {
                g = 1;
                start_max = vstart[i];
                end_max = vend[temp];
              }
            }
          } else {
            if (vend[temp] - vstart[i] + 1 > end_max - start_max + 1) {
              g = 1;
              start_max = vstart[i];
              end_max = vend[temp];
            }
          }
        }
      } else {
        if (vend[temp] - vstart[i] + 1 > end_max - start_max + 1) {
          g = 1;
          start_max = vstart[i];
          end_max = vend[temp];
        }
      }
    }
    if (binary_search(vstart, vstart + j, vend[i] + 2)) {
      temp = lower_bound(vstart, vstart + j, vend[i] + 2) - vstart;
      if (a[vstart[temp]] - a[vend[i]] >= 2) {
        if (vend[temp] - vstart[i] + 1 > end_max - start_max + 1) {
          g = 1;
          start_max = vstart[i];
          end_max = vend[temp];
        }
      }
    }
  }
  if (g == 0) {
    if (end_max - start_max + 1 < n)
      cout << (end_max - start_max + 2) << endl;
    else
      cout << n << endl;
  } else
    cout << (end_max - start_max + 1) << endl;
  return 0;
}
