#include <bits/stdc++.h>
using namespace std;
int solve(vector<int> const &a) {
  int n = a.size();
  vector<int> b(n);
  b[n - 1] = 1;
  for (int i = n - 2; i >= 0; --i) {
    b[i] = a[i] < a[i + 1] ? b[i + 1] + 1 : 1;
  }
  vector<int> c(n);
  c[0] = 1;
  for (int i = 1; i < n; ++i) {
    c[i] = a[i] > a[i - 1] ? c[i - 1] + 1 : 1;
  }
  int ret = *max_element(b.begin(), b.end());
  for (int i = 0; i < n; ++i) {
    ret = max(ret,
              max(i + 1 < n ? b[i + 1] + 1 : 1, i - 1 >= 0 ? c[i - 1] + 1 : 1));
    if (i + 1 < n && i - 1 >= 0 && a[i + 1] > a[i - 1] + 1) {
      ret = max(ret, c[i - 1] + b[i + 1] + 1);
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << solve(a) << endl;
  return 0;
}
