#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long mod = 1e9 + 7;
const long long NN = 1e5 + 10;
void solve(long long n) {
  long long i, j, k;
  long long m;
  vector<long long> v(n), left(n), right(n);
  for (i = 0; i < n; ++i) {
    cin >> v[i];
  }
  left[0] = 1;
  for (int i = 1; i < n; ++i) {
    if (v[i] > v[i - 1]) {
      left[i] = left[i - 1] + 1;
    } else {
      left[i] = 1;
    }
  }
  right[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (v[i] < v[i + 1]) {
      right[i] = right[i + 1] + 1;
    } else {
      right[i] = 1;
    }
  }
  long long ans = max(left[0], right[0]);
  ans = max(ans, max(left[n - 1], right[n - 1]));
  for (i = 1; i < n - 1; i++) {
    ans = max(ans, max(left[i], right[i]) + 1);
    if (v[i - 1] + 1 < v[i + 1]) {
      ans = max(ans, left[i - 1] + right[i + 1] + 1);
    }
  }
  if (n <= 2) ans = n;
  cout << ans << "\n";
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  solve(n);
  return 0;
}
