#include <bits/stdc++.h>
using namespace std;
int a[100009];
int l[100009];
int r[100009];
int n;
int main() {
  int i, j, k, m, d;
  while (cin >> n) {
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    int go = 1;
    l[1] = 1;
    for (i = 2; i <= n; i++) {
      if (a[i] > a[i - 1])
        go++;
      else
        go = 1;
      l[i] = go;
    }
    r[n] = 1;
    go = 1;
    for (i = n - 1; i >= 1; i--) {
      if (a[i] < a[i + 1])
        go++;
      else
        go = 1;
      r[i] = go;
    }
    int ans = 1;
    for (i = 1; i <= n; i++) {
      if (a[i - 1] + 1 < a[i + 1]) ans = max(ans, l[i - 1] + 1 + r[i + 1]);
      ans = max(ans, l[i - 1] + 1);
      ans = max(ans, r[i + 1] + 1);
    }
    printf("%d\n", ans);
  }
  return 0;
}
