#include <bits/stdc++.h>
FILE *in = stdin, *out = stdout;
int dy1[100005], dy2[100005];
int a[100005];
int n;
void input() {
  fscanf(in, "%d", &n);
  for (int i = 1; i <= n; i++) fscanf(in, "%d", &a[i]);
}
int Max(int x, int y) { return x > y ? x : y; }
void pro() {
  int ans = 1;
  dy1[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] > a[i - 1])
      dy1[i] = dy1[i - 1] + 1;
    else
      dy1[i] = 1;
    ans = Max(ans, dy1[i]);
  }
  dy2[n] = 1;
  for (int i = n - 1; i >= 1; i--) {
    if (a[i] < a[i + 1])
      dy2[i] = dy2[i + 1] + 1;
    else
      dy2[i] = 1;
    ans = Max(ans, dy2[i]);
  }
  ans = Max(dy2[2] + 1, dy1[n - 1] + 1);
  for (int i = 2; i < n; i++) {
    ans = Max(ans, dy1[i - 1] + 1);
    ans = Max(ans, dy2[i + 1] + 1);
    if (a[i - 1] < a[i + 1] - 1) ans = Max(ans, dy1[i - 1] + dy2[i + 1] + 1);
  }
  fprintf(out, "%d", ans);
}
int main() {
  input();
  pro();
  return 0;
}
