#include <bits/stdc++.h>
int fcin() {
  register int c = getchar();
  int x = 0;
  for (; (c < 48 || c > 57); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  return x;
}
using namespace std;
long long max3 = 1000000000000000000LL;
long long powe(long long a, int b) {
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % 1000000007;
    a = (a * 1LL * a) % 1000000007;
    b = b / 2;
  }
  return ans;
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  int t, n, m, i, j, k, l;
  t = 1;
  while (t--) {
    scanf("%d", &n);
    vector<long long> v[n + 9];
    long long a[n + 9];
    k = 0;
    for (i = 0; i < n; i++) {
      v[i].clear();
      scanf("%lld", &a[i]);
      if (!i || a[i] > a[i - 1])
        v[k].push_back(a[i]);
      else
        v[++k].push_back(a[i]);
    }
    int arr = k + 1;
    int mini[arr + 9], maxi[arr + 9];
    int ans = 1;
    int sum = 0;
    for (i = 0; i < arr; i++) {
      int z = v[i].size();
      ans = max(ans, z);
      if (arr > 1) ans = max(ans, z + 1);
      if (v[i].size() == 1) {
        mini[i] = 100000000000LL;
        maxi[i] = -1;
        continue;
      }
      mini[i] = v[i][1] - 1;
      maxi[i] = v[i][v[i].size() - 2] + 1;
    }
    for (i = 0; i < arr; i++) {
      if (!i) {
        continue;
      }
      if (mini[i] > v[i - 1][v[i - 1].size() - 1]) {
        int z = v[i].size() + v[i - 1].size();
        ans = max(ans, z);
      }
      if (maxi[i - 1] < v[i][0]) {
        int z = v[i].size() + v[i - 1].size();
        ans = max(ans, z);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
