#include <bits/stdc++.h>
using namespace std;
ifstream fin("probaC.in");
int r[100005], l[100005];
int mxv = 1, n;
int sir[100005];
int mx(int a, int b) {
  if (a > b) return a;
  return b;
}
int main() {
  int i;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> sir[i];
  if (n > 1) mxv = 2;
  r[n] = 1;
  for (i = n - 1; i >= 1; --i) {
    if (sir[i] < sir[i + 1])
      r[i] = r[i + 1] + 1;
    else
      r[i] = 1;
    mxv = mx(mxv, r[i] + ((i > 1) ? 1 : 0));
  }
  l[1] = 1;
  for (i = 2; i <= n; ++i) {
    if (sir[i] > sir[i - 1])
      l[i] = l[i - 1] + 1;
    else
      l[i] = 1;
    mxv = mx(mxv, l[i] + ((i < n) ? 1 : 0));
  }
  for (i = 2; i < n; ++i)
    if (sir[i - 1] + 1 < sir[i + 1]) mxv = mx(mxv, l[i - 1] + 1 + r[i + 1]);
  cout << mxv << '\n';
  return 0;
}
