#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100000 + 19;
int a[Maxn], Le[Maxn], Ri[Maxn], cnt, L, R, n, i, ans;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  Le[cnt = 1] = 1;
  a[++n] = a[n - 1] - 1;
  for (i = 1; i <= n; i++)
    if (a[i] <= a[i - 1]) {
      Ri[cnt] = i - 1;
      ans = max(ans, Ri[cnt] - Le[cnt] + 1);
      Le[++cnt] = i;
    }
  for (i = 1; i < cnt; i++) {
    if (Ri[i] < n - 1 || Le[i] > 1) ans = max(ans, Ri[i] - Le[i] + 2);
    if (i > 1)
      if (Ri[i - 1] > Le[i - 1] && Ri[i] > Le[i]) {
        if (a[Ri[i - 1] - 1] < a[Le[i]] - 1 || a[Ri[i - 1]] < a[Le[i] + 1] - 1)
          ans = max(ans, Ri[i] - Le[i - 1] + 1);
      } else {
        if (Ri[i - 1] == Le[i - 1]) ans = max(ans, Ri[i] - Le[i] + 2);
        if (Ri[i] == Le[i]) ans = max(ans, Ri[i - 1] - Le[i - 1] + 2);
      }
  }
  printf("%d\n", ans);
}
