#include <bits/stdc++.h>
using namespace std;
const long long int mxmx = 100100;
long long int n, a[mxmx];
long long int s[mxmx], e[mxmx];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int ANS = 0;
  for (long long int i = 0; i < n; i++) {
    e[i] = 1;
    if (i != 0) {
      if (a[i] > a[i - 1]) {
        e[i] += e[i - 1];
      }
    }
    ANS = max(ANS, e[i]);
    if (e[i] != n) {
      ANS = max(ANS, e[i] + 1);
    }
  }
  for (long long int i = n - 1; i >= 0; i--) {
    s[i] = 1;
    if (i != n - 1) {
      if (a[i] < a[i + 1]) {
        s[i] += s[i + 1];
      }
    }
    ANS = max(ANS, s[i]);
    if (s[i] != n) {
      ANS = max(ANS, s[i] + 1);
    }
  }
  for (long long int i = 0; i < n - 2; i++) {
    if (a[i] + 2 <= a[i + 2]) {
      ANS = max(ANS, e[i] + 1 + s[i + 2]);
    }
  }
  cout << ANS;
}
