#include <bits/stdc++.h>
using namespace std;
int n, a[100005], f[100005], l[100005];
int main() {
  cin >> n;
  int i;
  a[0] = 0x7fffffff;
  int ans = -1;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    f[i] = 1;
    if (a[i] > a[i - 1]) f[i] = f[i - 1] + 1;
    ans = ans > f[i] ? ans : f[i];
  }
  if (f[n] == n) {
    cout << n << endl;
    return 0;
  } else
    ans++;
  memcpy(l, f, sizeof(f));
  reverse(l + 1, l + n + 1);
  for (i = n; i >= 1; i--) {
    if (a[i] < a[i + 1])
      l[i] = l[i + 1] + 1;
    else
      l[i] = 1;
    if (a[i + 1] - 1 > a[i - 1])
      ans = ans > f[i - 1] + l[i + 1] + 1 ? ans : f[i - 1] + l[i + 1] + 1;
  }
  cout << ans << endl;
  return 0;
}
