#include <bits/stdc++.h>
using namespace std;
long long n, a[100007], m, ans, l, t = 1, ch = 0;
bool b[100007];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] > a[i - 1]) {
      b[i] = 1;
    }
  }
  int i = 1;
  m = -1;
  while (i <= n) {
    while (b[i] == 1) {
      m++;
      i++;
    }
    m++;
    l = max(m, l);
    if (a[i - 1] + 1 < a[i + 1] || (a[i - 2] < a[i] - 1 && i > 1)) {
      i++;
      t = i;
      m++;
      while (b[i] == 1) {
        m++;
        i++;
      }
      i = t;
    } else {
      i++;
    }
    ans = max(ans, m);
    m = 0;
  }
  if (l == ans && l != n) {
    cout << l + 1;
  } else
    cout << ans;
  return 0;
}
