#include <bits/stdc++.h>
using namespace std;
const long long N = 10e5 + 5;
const long long NN = 105;
const double pi = 3.14159;
const long long MAX = 2e5 + 123;
const long long MOD = 1e9 + 7;
const long long INF = 1000000000000000000;
const long long pw = 31;
void speed() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long n, mx, ans, dp[2 * N], a[2 * N];
vector<pair<long long, long long> > v;
int main() {
  speed();
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) {
    if (a[i] > a[i - 1])
      ans++;
    else {
      v.push_back({i - ans, i - 1});
      ans = 1;
    }
    dp[i] = ans;
  }
  for (long long i = 1; i <= n; i++) mx = max(mx, dp[i]);
  v.push_back({n - ans + 1, n});
  for (long long i = 0; i < v.size() - 1; i++) {
    if (a[v[i].second - 1] < a[v[i + 1].first])
      mx = max(mx, dp[v[i].second - 1] + dp[v[i + 1].second]);
    if (a[v[i].second] < a[v[i + 1].first + 1])
      mx = max(mx, dp[v[i].second] + (dp[v[i + 1].second] - 1));
  }
  cout << mx;
}
