#include <bits/stdc++.h>
using namespace std;
int n, a[300005], l[300005], r[300005];
int main() {
  char str[80];
  for (int t = 1; t <= 1; t++) {
    sprintf(str, "%d.in", t);
    sprintf(str, "%d.out", t);
    scanf("%d", &n);
    int ans = 1;
    for (int i = 1; i <= n; i++) scanf("%d", a + i);
    l[1] = r[n] = 1;
    for (int i = 2; i <= n; i++) {
      l[i] = 1;
      if (a[i] > a[i - 1]) l[i] = l[i - 1] + 1;
    }
    for (int i = n - 1; i >= 1; i--) {
      r[i] = 1;
      if (a[i] < a[i + 1]) r[i] = r[i + 1] + 1;
    }
    for (int i = 1; i <= n; i++) {
      if (a[i - 1] + 1 < a[i + 1]) ans = max(ans, l[i - 1] + r[i + 1] + 1);
      ans = max(ans, l[i] + 1);
      ans = max(ans, r[i] + 1);
    }
    printf("%d", min(n, ans));
  }
  return 0;
}
