#include <bits/stdc++.h>
using namespace std;
vector<long long> arriba, abajo, a;
long long ans = 1, n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  a.resize(n);
  arriba.resize(n);
  abajo.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (i == 0)
      arriba[i] = 1;
    else if (a[i] > a[i - 1])
      arriba[i] = arriba[i - 1] + 1;
    else
      arriba[i] = 1;
    ans = max(ans, arriba[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      abajo[i] = 1;
    else if (a[i] < a[i + 1])
      abajo[i] = abajo[i + 1] + 1;
    else
      abajo[i] = 1;
    ans = max(ans, abajo[i]);
  }
  for (int i = 0; i < n; i++) {
    if (i > 0 and i + 1 < n and a[i - 1] < a[i + 1] and
        a[i + 1] - a[i - 1] >= 2)
      ans = max(ans, arriba[i - 1] + abajo[i + 1] + 1);
    if (i > 1 and a[i] <= a[i - 1]) ans = max(ans, arriba[i - 1] + 1);
    if (i + 1 < n and a[i] >= a[i + 1]) ans = max(ans, abajo[i + 1] + 1);
  }
  cout << ans;
}
