#include <bits/stdc++.h>
using namespace std;
int a[100010];
int dp[100010][2];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dp[0][0] = 0;
  a[0] = -99999;
  for (int i = 1; i <= n; i++) {
    if (a[i] > a[i - 1]) {
      dp[i][0] = dp[i - 1][0] + 1;
      dp[i][1] = dp[i - 1][1] + 1;
    } else {
      dp[i][0] = 1;
      dp[i][1] = 1;
    }
    if (i > 1 && a[i] - a[i - 2] > 1) {
      dp[i][1] = max(dp[i][1], dp[i - 2][0] + 2);
    }
  }
  int ma = min(n, dp[n][0] + 1);
  for (int i = 1; i <= n; i++) {
    ma = max(ma, max(dp[i][0], max(dp[i - 1][0] + 1, dp[i][1])));
  }
  cout << ma << endl;
}
