#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n + 2];
  arr[0] = 0;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  arr[n + 1] = INT_MAX;
  int left[100005] = {}, ans = 0;
  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]);
  }
  if (ans < n) ans++;
  int right[100005] = {};
  for (int i = n; i >= 1; i--) {
    if (arr[i] < arr[i + 1])
      right[i] = right[i + 1] + 1;
    else
      right[i] = 1;
    if (arr[i + 1] - arr[i - 1] > 1)
      ans = max(ans, left[i - 1] + right[i + 1] + 1);
  }
  cout << ans << endl;
  return 0;
}
