#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int a[N];
vector<pair<int, int> > segment;
int get_len(pair<int, int> seg) { return seg.second - seg.first + 1; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  int start = 1, ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] >= a[i + 1]) {
      segment.push_back({start, i});
      start = i + 1;
      ans = max(ans, get_len(segment.back()));
    }
  }
  for (int i = 1; i < (int)(segment).size(); ++i) {
    int j = segment[i - 1].second;
    int k = segment[i].first;
    if ((get_len(segment[i]) > 1 and a[j] + 1 < a[k + 1]) or
        (get_len(segment[i - 1]) > 1 and a[k] - 1 > a[j - 1])) {
      ans = max(ans, get_len(segment[i - 1]) + get_len(segment[i]));
    }
    ans = max(ans, get_len(segment[i]) + 1);
    ans = max(ans, get_len(segment[i - 1]) + 1);
  }
  return !printf("%d\n", ans);
}
