#include <bits/stdc++.h>
using namespace std;
int n, a[100002], s[100002], e[100002], m;
int main() {
  cin >> n;
  a[n + 1] = 2000000;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    e[i] = (a[i - 1] < a[i]) ? (e[i - 1] + 1) : 1;
    m = max(m, e[i]);
  }
  if (m < n) ++m;
  for (int i = n; i; --i) {
    s[i] = (a[i] < a[i + 1]) ? (s[i + 1] + 1) : 1;
    if (a[i + 1] - a[i - 1] > 1) m = max(m, e[i - 1] + s[i + 1] + 1);
  }
  cout << m;
  return 0;
}
