#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const int INF = 1000 * 1000 * 1000;
const int maxn = 110000;
int arr[maxn], dp[maxn], dp2[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, k;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> arr[i];
  dp[0] = 1;
  int ans = 1;
  for (int i = 1; i < N; i++) {
    if (arr[i] > arr[i - 1])
      dp[i] = dp[i - 1] + 1;
    else
      dp[i] = 1;
    if (i != N - 1) ans = max(ans, dp[i] + 1);
    ans = max(ans, dp[i]);
  }
  dp2[N - 1] = 1;
  for (int i = N - 2; i >= 0; i--) {
    if (arr[i] < arr[i + 1])
      dp2[i] = dp2[i + 1] + 1;
    else
      dp2[i] = 1;
    if (i != 0) ans = max(ans, dp2[i] + 1);
    ans = max(ans, dp2[i]);
  }
  if (N > 1) ans = max(ans, dp2[1] + 1);
  if (N > 1) ans = max(ans, dp[N - 2] + 1);
  for (int i = 1; i < N - 1; i++) {
    if (arr[i + 1] - 1 > arr[i - 1]) {
      int t = dp[i - 1] + dp2[i + 1] + 1;
      ans = max(ans, t);
    }
  }
  cout << ans << endl;
  return 0;
}
