#include <bits/stdc++.h>
using namespace std;
int inf = 1000000005;
long long int llinf = 4000000000000000005LL;
long long int mod = 1000000007;
long long int mod9 = 1000000009;
double pi = 3.1415926535897;
double eps = 1e-15;
int dx[] = {1, 1, -1, -1};
int dy[] = {1, -1, 1, -1};
vector<bool> isprime;
set<int> primes;
void seive(int n, bool wantlist = true) {
  isprime.resize(n + 1, true);
  isprime[0] = isprime[1] = false;
  int sq = sqrt(n + 1);
  for (int i = 2; i < sq + 1; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= n; j += i) isprime[j] = false;
    }
  }
  for (int i = 2; wantlist && i <= n; i++) {
    if (isprime[i]) primes.insert(i);
  }
}
template <class T>
inline T gcd(T a, T b) {
  while (b > 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
template <class T>
inline vector<T> operator+(vector<T>& a, vector<T>& b) {
  assert(a.size() == b.size());
  int n = a.size();
  vector<T> c(n);
  for (int i = 0; i < n; i++) c[i] = a[i] + b[i];
  return c;
}
inline long long int bexp(long long int x, long long int n) {
  long long int res = 1;
  x %= mod;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
inline bool ispalin(string& str) {
  int n = str.length();
  for (int i = 0; i < n / 2; i++)
    if (str[i] != str[n - i - 1]) return false;
  return true;
}
inline void mapper(vector<int>& a, int idx = 0) {
  int n = a.size();
  vector<int> x(a);
  sort(x.begin(), x.end());
  int m = unique(x.begin(), x.end()) - x.begin();
  map<int, int> mapp;
  for (int i = m; i >= 0; i--) mapp[x[i]] = i + idx;
  for (int i = 0; i < n; i++) a[i] = mapp[a[i]];
}
inline int digsum(int n) {
  int res = 0;
  while (n > 0) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  ;
  vector<int> a(n), l(n), r(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  ;
  if (n == 1) {
    printf("%d\n", 1);
    ;
    return 0;
  }
  l[0] = 1;
  for (int i = 1; i < n; i++) l[i] = 1 + (a[i] > a[i - 1]) * l[i - 1];
  r[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) r[i] = 1 + (a[i] < a[i + 1]) * r[i + 1];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i < n - 1) ans = max(ans, 1 + r[i + 1]);
    if (i > 0) ans = max(ans, 1 + l[i - 1]);
    if (i > 0 && i < n - 1 && a[i - 1] + 1 < a[i + 1])
      ans = max(ans, 1 + l[i - 1] + r[i + 1]);
  }
  cout << ans << endl;
}
