#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n; ++i) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  vector<vector<int>> inc;
  int last = (int)1e9 + 1;
  auto l = v.begin();
  for (auto it = v.begin(); it != v.end(); ++it) {
    int i = *it;
    if (i > last) {
      last = i;
    } else {
      inc.push_back(vector<int>(l, it));
      l = it;
      last = i;
    }
  }
  inc.push_back(vector<int>(l, v.end()));
  int mx = 0;
  for (int i = 1; i < (int)inc.size(); ++i) {
    mx = max((int)(inc[i].size()), mx);
  }
  for (int i = 1; i < (int)inc.size() - 1; ++i) {
    if (inc[i + 1].size() == 1) {
      mx = max(mx, (int)(inc[i].size()) + 1);
    } else {
      if (inc[i + 1][1] > inc[i].back() + 1) {
        mx = max(mx, (int)(inc[i].size()) + (int)(inc[i + 1].size()));
      } else {
        mx = max(mx, (int)(inc[i].size()) + 1);
      }
    }
  }
  for (int i = inc.size() - 1; i >= 2; --i) {
    if (inc[i - 1].size() == 1) {
      mx = max(mx, (int)(inc[i].size()) + 1);
    } else {
      if (inc[i - 1][inc[i - 1].size() - 2] + 1 < inc[i][0]) {
        mx = max(mx, (int)(inc[i].size()) + (int)(inc[i - 1].size()));
      } else {
        mx = max(mx, (int)(inc[i].size()) + 1);
      }
    }
  }
  cout << mx << endl;
  return 0;
}
