#include <bits/stdc++.h>
using namespace std;
long long int P = pow(10, 9) + 7;
const long long int N = 1e5 + 10;
long long int n, a[N], ans, ii[N], s[N];
void solve() {
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    ii[i] = (a[i - 1] < a[i]) ? ii[i - 1] + 1 : 1;
    ans = max(ii[i], ans);
  }
  if (ans < n) ++ans;
  for (long long int i = n; i; i--) {
    s[i] = (a[i + 1] > a[i]) ? s[i + 1] + 1 : 1;
    if (a[i + 1] - a[i - 1] > 1) ans = max(ans, ii[i - 1] + s[i + 1] + 1);
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
