#include <bits/stdc++.h>
using namespace std;
int N;
int A[100000];
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  if (N == 1) {
    cout << 1;
    return 0;
  }
  vector<pair<long long, long long> > segments;
  int k = 0, b = 0, i;
  for (i = 1; i < N; i++) {
    if (A[i - 1] >= A[i]) {
      segments.push_back(make_pair(b, i - 1));
      b = i;
      k++;
    }
  }
  segments.push_back(make_pair(b, i - 1));
  if (segments.size() == 1) {
    cout << 1 + segments[0].second - segments[0].first;
    return 0;
  }
  long long best = 0;
  for (i = 0; i < segments.size(); i++) {
    best = max(best, 2 + segments[i].second - segments[i].first);
    if (i == 0) {
      if (segments[i].second - segments[i].first != 0) {
        int lastleft = A[segments[i].second - 1];
        int firstright = A[segments[i + 1].first];
        if (lastleft < firstright && firstright - lastleft > 1) {
          best = max(best, 2 + segments[i].second - segments[i].first +
                               segments[i + 1].second - segments[i + 1].first);
        }
      } else {
        best = max(best, 2 + segments[i + 1].second - segments[i + 1].first);
      }
    } else if (i == segments.size() - 1) {
      if (segments[i].second - segments[i].first != 0) {
        int lastleft = A[segments[i - 1].second];
        int firstright = A[segments[i].first + 1];
        if (lastleft < firstright && firstright - lastleft > 1) {
          best = max(best, 2 + segments[i - 1].second - segments[i - 1].first +
                               segments[i].second - segments[i].first);
        }
      } else {
        best = max(best, 2 + segments[i - 1].second - segments[i - 1].first);
      }
    } else {
      if (segments[i].second - segments[i].first != 0) {
        int lastleft = A[segments[i].second - 1];
        int firstright = A[segments[i + 1].first];
        if (lastleft < firstright && firstright - lastleft > 1) {
          best = max(best, 2 + segments[i].second - segments[i].first +
                               segments[i + 1].second - segments[i + 1].first);
        }
        lastleft = A[segments[i - 1].second];
        firstright = A[segments[i].first + 1];
        if (lastleft < firstright && firstright - lastleft > 1) {
          best = max(best, 2 + segments[i - 1].second - segments[i - 1].first +
                               segments[i].second - segments[i].first);
        }
      } else {
        int lastleft = A[segments[i - 1].second];
        int firstright = A[segments[i + 1].first];
        if (lastleft < firstright && firstright - lastleft > 1) {
          best = max(best, 3 + segments[i - 1].second - segments[i - 1].first +
                               segments[i + 1].second - segments[i + 1].first);
        } else {
          best = max(best, 2 + segments[i - 1].second - segments[i - 1].first);
          best = max(best, 2 + segments[i + 1].second - segments[i + 1].first);
        }
      }
    }
  }
  cout << best;
  return 0;
}
