#include <bits/stdc++.h>
struct debugger {
  template <typename T>
  debugger operator,(const T& v) {
    std::cout << v << " ";
    return (*this);
  }
} dbg;
using namespace std;
long long arr[100000 + 10];
long long dp[100000 + 10];
long long ind[100000 + 10];
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = (1); i <= (n); ++i) {
    cin >> arr[i];
  }
  dp[1] = 1;
  ind[1] = 1;
  long long ans = 1;
  for (int i = (2); i <= (n); ++i) {
    dp[i] = (arr[i] > arr[i - 1] ? (dp[i - 1] + 1) : 1);
    ans = max(ans, dp[i]);
    ;
  }
  for (int i = (1); i <= (n); ++i) {
    ind[i - dp[i] + 1] = max(dp[i], ind[i - dp[i] + 1]);
  }
  for (int i = (2); i <= (n); ++i) {
    if (dp[i] == 1 && i != n) {
      if (arr[i + 1] - arr[i - 1] >= 2) ans = max(ans, ind[i] + dp[i - 1]);
      if (i >= 3)
        if (arr[i] - arr[i - 2] >= 2) ans = max(ans, ind[i] + dp[i - 1]);
    }
  }
  for (int i = (1); i <= (n); ++i) {
    if (dp[i] == 1) {
      if (i != 1) {
        ans = max(ans, dp[i - 1] + 1);
      }
    }
    if (i != 1 && dp[i] == 1) {
      ans = max(ans, ind[i] + 1);
    }
  }
  cout << ans << endl;
}
