#include <bits/stdc++.h>
using namespace std;
int solve(const vector<int>& x, const vector<int>& y) {
  if (x.size() == 1 || y.size() == 1 || x[x.size() - 2] <= y[0] ||
      x[x.size() - 1] <= y[1]) {
    return x.size() + y.size();
  }
  return max(x.size(), y.size()) + 1;
}
int main() {
  int n, x;
  cin >> n;
  vector<vector<int> > v;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    x -= i;
    if (v.empty() || v.back().back() > x)
      v.emplace_back(vector<int>(1, x));
    else
      v.back().push_back(x);
  }
  int res = v[0].size();
  for (int i = 1; i < v.size(); ++i) res = max(res, solve(v[i - 1], v[i]));
  cout << res << endl;
  return 0;
}
