#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ans;
int seq[110000];
int main() {
  int n, i;
  scanf("%d", &n);
  int el = -1, len = 0;
  int bs = 0;
  for (i = 0; i < n; i++) {
    int vl;
    scanf("%d", &vl);
    seq[i] = vl;
    if (vl > el) {
      el = vl;
      len++;
    } else {
      ans.push_back(pair<int, int>(i - len, i - 1));
      bs = max(bs, len);
      el = vl;
      len = 1;
    }
  }
  ans.push_back(pair<int, int>(i - len, i - 1));
  bs = max(bs, len);
  for (i = 0; i < (int)ans.size(); i++)
    if (ans[i].first > 0)
      bs = max(bs, ans[i].second - ans[i].first + 2);
    else if (ans[i].second < n - 1)
      bs = max(bs, ans[i].second - ans[i].first + 2);
  for (i = 1; i < (int)ans.size(); i++)
    if (ans[i].first - ans[i - 1].second == 1) {
      if (seq[ans[i - 1].second] + 1 < seq[ans[i].first + 1] ||
          ans[i].second == ans[i].first)
        bs = max(bs, ans[i].second - ans[i - 1].first + 1);
      if (seq[ans[i - 1].second - 1] + 1 < seq[ans[i].first] ||
          ans[i - 1].second == ans[i - 1].first)
        bs = max(bs, ans[i].second - ans[i - 1].first + 1);
    }
  printf("%d\n", bs);
  return 0;
}
