#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, a[maxn], dp[maxn][2];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(dp, 0, sizeof dp);
  dp[1][1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i][1] = 1;
    if (a[i] > a[i - 1]) dp[i][0] = dp[i - 1][0] + 1;
    if (i - 2 >= 1 && a[i] - a[i - 2] > 1)
      dp[i][0] = max(dp[i][0], dp[i - 2][1] + 2);
    if (a[i] > a[i - 1]) dp[i][1] = dp[i - 1][1] + 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (dp[i][1] != n)
      ans = max(ans, dp[i][1] + 1);
    else
      ans = n;
    ans = max(ans, dp[i][0]);
  }
  cout << ans << endl;
  return 0;
}
