#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
vector<pair<int, int> > v;
int a[100009];
int main() {
  int cs = 1, t, i, j, n, l, lst;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  l = 0;
  lst = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] <= lst) {
      v.push_back(make_pair(l, i - 1));
      l = i;
      lst = a[i];
    } else
      lst = a[i];
  }
  v.push_back(make_pair(l, i - 1));
  if (v.size() == 1) {
    printf("%d\n", n);
    return 0;
  }
  int mx = 2;
  for (i = 0; i < v.size(); i++) {
    if (v[i].first > 0 || v[i].second < n - 1)
      mx = max(mx, v[i].second - v[i].first + 2);
    if (i < v.size() - 2 && v[i + 1].second - v[i + 1].first == 0) {
      if (a[v[i + 2].first] > a[v[i].second] + 1)
        mx = max(mx, v[i].second - v[i].first + 1 + v[i + 2].second -
                         v[i + 2].first + 1 + 1);
    }
    if (i < v.size() - 1 && v[i + 1].second - v[i + 1].first > 0 &&
        a[v[i + 1].first + 1] > a[v[i].second] + 1) {
      mx = max(mx, v[i].second - v[i].first + 1 + v[i + 1].second -
                       v[i + 1].first + 1);
    }
    if (i > 1 && v[i - 1].second - v[i - 1].first == 0 &&
        a[v[i - 2].second] + 1 < a[v[i].first])
      mx = max(mx, v[i].second - v[i].first + 1 + v[i - 2].second -
                       v[i - 2].first + 1 + 1);
    if (i > 0 && v[i - 1].second - v[i - 1].first > 0 &&
        a[v[i - 1].second - 1] + 1 < a[v[i].first])
      mx = max(mx, v[i].second - v[i].first + 1 + v[i - 1].second -
                       v[i - 1].first + 1);
  }
  if (mx > n) mx = n;
  cout << mx << endl;
  return 0;
}
