#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, long long> ll;
typedef vector<long long> vl;
typedef vector<ll> vll;
typedef vector<vl> vvl;
template <typename T>
ostream &operator<<(ostream &o, vector<T> v) {
  if (v.size() > 0) o << v[0];
  for (unsigned i = 1; i < v.size(); i++) o << " " << v[i];
  return o << " ";
}
template <typename U, typename V>
ostream &operator<<(ostream &o, pair<U, V> p) {
  return o << "(" << p.first << ", " << p.second << ") ";
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (unsigned i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
template <typename T>
istream &operator>>(istream &in, pair<T, T> &p) {
  in >> p.first;
  in >> p.second;
  return in;
}
template <typename T>
ostream &operator<<(ostream &o, set<T> v) {
  for (auto &it : v) o << it << " ";
  return o << "\n";
}
template <typename T, typename U>
ostream &operator<<(ostream &o, map<T, U> v) {
  for (auto &it : v) o << it << " ";
  return o << "\n";
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
int main(int argc, char *argv[]) {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  long long n;
  cin >> n;
  vl a(n);
  cin >> a;
  vl b(n, 0), c(n, 0);
  long long ans = 1;
  b[0] = 1;
  for (long long i = (1); i < (long long)n; i++) {
    ans = max(ans, b[i - 1] + 1);
    b[i] = 1;
    if (a[i] > a[i - 1]) b[i] += b[i - 1];
  }
  c[n - 1] = 1;
  for (long long i = (n - 2); i >= (0); i--) {
    ans = max(ans, c[i + 1] + 1);
    c[i] = 1;
    if (a[i] < a[i + 1]) c[i] += c[i + 1];
  }
  for (long long i = (1); i < (long long)n - 1; i++) {
    if (a[i - 1] + 2 <= a[i + 1]) ans = max(ans, b[i - 1] + c[i + 1] + 1);
  }
  cout << ans << "\n";
  return 0;
}
