#include <bits/stdc++.h>
using namespace std;
int A[100005];
int dp1[100005], dp2[100005];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(dp1, 0, sizeof(dp1));
    memset(dp2, 0, sizeof(dp2));
    scanf("%d", A + 1);
    dp1[1] = 1;
    for (int i = 2; i <= n; i++) {
      scanf("%d", A + i);
      if (A[i] > A[i - 1])
        dp1[i] = dp1[i - 1] + 1;
      else
        dp1[i] = 1;
    }
    dp2[n] = 1;
    for (int i = n - 1; i >= 1; i--) {
      if (A[i] < A[i + 1])
        dp2[i] = dp2[i + 1] + 1;
      else
        dp2[i] = 1;
    }
    int m = 1;
    A[0] = 0;
    A[n + 1] = 1000000005;
    for (int i = 1; i <= n; i++) {
      int t = dp1[i - 1] + dp2[i + 1] + 1;
      if (A[i + 1] - A[i - 1] < 2) t = max(dp1[i], dp2[i]) + 1;
      m = max(m, t);
    }
    printf("%d\n", m);
  }
  return 0;
}
