#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  vector<int> left(n, 1);
  vector<int> right(n, 1);
  int ans = 0;
  for (int i = 1; i < n; i++)
    left[i] = A[i] > A[i - 1] ? left[i - 1] + 1 : 1,
    ans = max(ans, left[i - 1] + 1);
  for (int i = n - 2; i >= 0; i--)
    right[i] = A[i] < A[i + 1] ? right[i + 1] + 1 : 1,
    ans = max(ans, right[i + 1] + 1);
  for (int i = 1; i < n - 1; i++) {
    if (A[i + 1] > A[i - 1] + 1) ans = max(ans, left[i - 1] + 1 + right[i + 1]);
  }
  if (n <= 2) ans = n;
  cout << ans << endl;
  return 0;
}
