#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a > b) return a;
  return b;
}
int main() {
  int n;
  int arr[100010];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int ptr1 = 0;
  int ptr2 = 0;
  pair<int, int> inc[100010];
  int cnt = 0;
  int ret = 0;
  while (ptr1 < n) {
    ptr2 = ptr1 + 1;
    while (ptr2 < n && arr[ptr2] > arr[ptr2 - 1]) {
      ptr2++;
    }
    pair<int, int> pr(ptr1, ptr2 - 1);
    ret = max(ret, ptr2 - ptr1);
    inc[cnt++] = pr;
    ptr1 = ptr2;
  }
  if (ret != n) {
    ret++;
  }
  for (int i = 0; i < cnt - 1; i++) {
    pair<int, int> f = inc[i];
    pair<int, int> s = inc[i + 1];
    int fbeg = get<0>(f);
    int fend = get<1>(f);
    int sbeg = get<0>(s);
    int send = get<1>(s);
    if (fbeg == fend || arr[fend - 1] < arr[sbeg] - 1) {
      ret = max(ret, send - fbeg + 1);
    } else if (sbeg == send || arr[sbeg + 1] > arr[fend] + 1) {
      ret = max(ret, send - fbeg + 1);
    }
  }
  for (int i = 1; i < cnt - 1; i++) {
    pair<int, int> f = inc[i];
    int fbeg = get<0>(f);
    int fend = get<1>(f);
    if (fbeg == fend && arr[fbeg - 1] < arr[fbeg + 1]) {
      ret = max(ret, get<1>(inc[i + 1]) - get<0>(inc[i - 1]) + 1);
    }
  }
  cout << ret << endl;
  return 0;
}
