#include <bits/stdc++.h>
using namespace std;
int lft[100010];
int rgt[100010];
int A[100010];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < (N); ++i) scanf("%d", A + i);
  memset(lft, 0, sizeof(lft));
  memset(rgt, 0, sizeof(rgt));
  int ans = 0;
  for (int i = 0; i < (N); ++i)
    lft[i] = 1 + ((i && A[i - 1] < A[i]) ? lft[i - 1] : 0);
  for (int i = (N - 1); i >= (0); --i)
    rgt[i] = 1 + ((i < N - 1 && A[i + 1] > A[i]) ? rgt[i + 1] : 0);
  for (int i = 0; i < (N); ++i) {
    ans = max(ans, (i ? lft[i - 1] : 0) + 1);
    ans = max(ans, 1 + (i < N - 1 ? rgt[i + 1] : 0));
    if (i && i < N - 1 && A[i - 1] < A[i + 1] - 1)
      ans = max(ans, lft[i - 1] + 1 + rgt[i + 1]);
  }
  cout << ans << endl;
}
