#include <bits/stdc++.h>
using namespace std;
ifstream f("date.in");
int n, v[200001];
int main() {
  int st[200001], dr[200001];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i];
  st[1] = dr[n] = 1;
  for (int i = 2; i <= n; i++) {
    if (v[i] > v[i - 1])
      st[i] = st[i - 1] + 1;
    else
      st[i] = 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (v[i] < v[i + 1])
      dr[i] = dr[i + 1] + 1;
    else
      dr[i] = 1;
  }
  int maxx = max(st[n - 1], dr[2]) + 1;
  for (int i = 2; i < n; i++) {
    if (v[i + 1] - v[i - 1] > 1)
      maxx = max(maxx, st[i - 1] + dr[i + 1] + 1);
    else
      maxx = max(maxx, max(st[i - 1], dr[i + 1]) + 1);
  }
  cout << maxx;
}
