#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, ans;
int a[100005], f[100005][2][2];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) {
    f[i][0][0] = f[i][1][1] = 1;
    if (i != 1) f[i][1][0] = 2;
    if (a[i] > a[i - 1]) {
      f[i][0][0] = max(f[i][0][0], f[i - 1][0][0] + 1);
      f[i][1][0] = max(f[i][1][0], f[i - 1][1][0] + 1);
      f[i][1][1] = max(f[i][1][1], f[i - 1][0][0] + 1);
    } else {
      f[i][1][1] = max(f[i][1][1], f[i - 1][0][0] + 1);
    }
    if (i != 1 && a[i] > a[i - 2] + 1)
      f[i][1][0] = max(f[i][1][0], f[i - 1][1][1] + 1);
    ans = max(ans, f[i][0][0]);
    ans = max(ans, f[i][1][0]);
    ans = max(ans, f[i][1][1]);
  }
  printf("%d", ans);
}
