#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, inf = 1000000007;
const double eps = 0.000000001;
int n, a[N], dp[N], s = -inf;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  a[0] = inf;
  for (int i = 1; i <= n; i++) {
    dp[i] = 1;
    if (a[i - 1] < a[i]) dp[i] += dp[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    s = max(s, dp[i]);
    if (dp[i] == i) continue;
    s = max(s, dp[i] + 1);
    if (dp[i] == 1 || dp[i - dp[i]] == 1) {
      s = max(s, dp[i] + dp[i - dp[i]]);
      continue;
    }
    if (a[i - dp[i]] + 1 < a[i - dp[i] + 2] ||
        a[i - dp[i] - 1] + 1 < a[i - dp[i] + 1])
      s = max(s, dp[i] + dp[i - dp[i]]);
  }
  printf("%d\n", s);
  return 0;
}
