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