#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 1;
  vector<int> a, l, r;
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  l.resize(n);
  l[0] = 1;
  for (int i = 1; i < n; i++) l[i] = a[i] > a[i - 1] ? l[i - 1] + 1 : 1;
  r.resize(n);
  r[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) r[i] = a[i] < a[i + 1] ? r[i + 1] + 1 : 1;
  for (int i = 1; i < n; i++)
    if (a[i - 1] < a[i])
      ans = max(ans, l[i - 1] + r[i]);
    else {
      ans = max(ans, l[i - 1] + 1);
      ans = max(ans, r[i] + 1);
    }
  for (int i = 1; i < n - 1; i++)
    if (a[i - 1] + 1 < a[i + 1]) ans = max(ans, l[i - 1] + r[i + 1] + 1);
  cout << ans << endl;
  return 0;
}
