#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long& i : a) cin >> i;
  vector<long long> pre(n), suf(n);
  long long cnt{1};
  pre[0] = 1;
  for (long long i = 1; i < n; i++) {
    if (a[i] > a[i - 1]) {
      cnt++;
    } else {
      cnt = 1;
    }
    pre[i] = cnt;
  }
  suf[n - 1] = 1;
  cnt = 1;
  for (long long i = n - 2; i >= 0; i--) {
    if (a[i] < a[i + 1]) {
      cnt++;
    } else {
      cnt = 1;
    }
    suf[i] = cnt;
  }
  long long mx{1};
  for (long long i = 0; i < n - 2; i++) {
    long long x = pre[i];
    long long y = suf[i + 2];
    if (a[i] + 1 < a[i + 2]) {
      mx = max(mx, x + y + 1);
    } else {
      mx = max(mx, max(pre[i] + 1, suf[i + 2] + 1));
    }
  }
  if (n >= 2) {
    mx = max(mx, suf[1] + 1);
    mx = max(mx, pre[n - 2] + 1);
  }
  cout << mx;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
