#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 5;
int n;
int a[N], lft[N], rgt[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  lft[0] = 1;
  for (int i = 1; i < n; i++)
    if (a[i] > a[i - 1])
      lft[i] = lft[i - 1] + 1;
    else
      lft[i] = 1;
  rgt[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--)
    if (a[i] < a[i + 1])
      rgt[i] = rgt[i + 1] + 1;
    else
      rgt[i] = 1;
  int ret = 1 + max(*max_element(rgt, rgt + n), *max_element(lft, lft + n));
  ret = min(ret, n);
  for (int i = 1; i < n - 1; i++)
    if (a[i - 1] + 1 < a[i + 1]) ret = max(ret, lft[i - 1] + rgt[i + 1] + 1);
  cout << ret << '\n';
  return 0;
}
