#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
inline void cn(long& n) {
  n = 0;
  long ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
template <class T>
void cmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
int len(const T& c) {
  return (int)c.size();
}
template <class T>
int len(char c[]) {
  return (int)strlen(c);
}
string itos(long n) {
  string s;
  while (n) {
    s += (n % 10 + 48);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
long stoi(string s) {
  long n = 0;
  for (int i(0), _n(len(s)); i < _n; ++i) n = n * 10 + (s[i] - 48);
  return n;
}
long long n, ar[100005], last, c, cum[100005], dp[100005], r, k;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i(0), _n(n); i < _n; ++i) {
    cin >> ar[i];
  }
  last = 0;
  c = 1;
  cum[0] = 1;
  set<long> st;
  st.insert(0);
  long long res = 0;
  for (int i(1), _n(n - 1); i <= _n; ++i) {
    if (ar[i] > ar[i - 1]) {
      c++;
      cum[i] = c;
    } else {
      if (last > 0 || i < n - 1)
        cmax(res, c + 1);
      else
        cmax(res, c);
      cum[i] = 1;
      dp[last] = c;
      last = i;
      c = 1;
      st.insert(i);
    }
  }
  if (last > 0)
    cmax(res, c + 1);
  else
    cmax(res, c);
  dp[last] = c;
  for (int i(1), _n(n - 2); i <= _n; ++i) {
    if (ar[i + 1] - ar[i - 1] >= 2 &&
        (ar[i] <= ar[i - 1] || ar[i] >= ar[i + 1])) {
      r = cum[i - 1] + 1;
      k = 0;
      if (st.find(i) != st.end()) {
        k = dp[i] - 1;
      }
      if (st.find(i + 1) != st.end()) {
        cmax(k, dp[i + 1]);
      }
      r += k;
      cmax(res, r);
    }
  }
  cmax(res, 1 + cum[n - 2]);
  cout << res;
}
