#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int mod = 1000000007;
const int maxn = 100010;
int n, a[maxn], w[maxn];
int main() {
  while (scanf("%d", &n) == 1) {
    a[0] = inf;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] > a[i - 1])
        w[i] = w[i - 1] + 1;
      else
        w[i] = 1;
    }
    int ans = 0;
    for (int i = n; i > 0; i--) {
      int k = w[i];
      if (i - k == 0) {
        ans = max(ans, k);
        break;
      } else {
        if (a[i - k + 2] - a[i - k] >= 2) {
          ans = max(ans, k + w[i - k]);
        } else if (a[i - k + 1] - a[i - k - 1] >= 2)
          ans = max(ans, k + w[i - k]);
        else {
          ans = max(ans, k + 1);
        }
        i = i - k + 1;
      }
    }
    for (int i = 2; i <= n; i++)
      if (w[i] == 1) {
        ans = max(ans, w[i - 1] + 1);
      }
    cout << ans << endl;
  }
  return 0;
}
