#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
int a[N];
int f[N], g[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  f[1] = 1;
  cin >> a[1];
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
    if (a[i] > a[i - 1])
      f[i] = f[i - 1] + 1;
    else
      f[i] = 1;
  }
  g[n] = 1;
  for (int i = n - 1; i >= 1; i--) {
    if (a[i] < a[i + 1])
      g[i] = g[i + 1] + 1;
    else
      g[i] = 1;
  }
  int ans = max(g[2] + 1, f[n - 1] + 1);
  for (int i = 2; i < n; i++) ans = max(ans, max(f[i] + 1, g[i] + 1));
  for (int i = 2; i < n; i++) {
    if (a[i + 1] > a[i - 1] + 1) ans = max(ans, f[i - 1] + 1 + g[i + 1]);
  }
  cout << ans << endl;
  return 0;
}
