#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int n;
map<pair<int, pair<bool, int> >, int> memo;
int solve(int idx, bool f, int last) {
  if (idx == n) return 0;
  int &ret = memo[{idx, {f, last}}];
  if (ret) return ret;
  if (!f) {
    if (arr[idx] > last)
      ret = 1 + max(solve(idx + 1, 0, arr[idx]), solve(idx + 1, 1, last + 1));
    else
      ret = 1 + solve(idx + 1, 1, last + 1);
  } else if (arr[idx] > last)
    ret = 1 + solve(idx + 1, f, arr[idx]);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < (long long)(n); i++) cin >> arr[i];
  int mx = 0;
  for (int i = 0; i < (long long)(n); i++) mx = max(mx, solve(i, 0, -1e9));
  cout << mx << '\n';
  return 0;
}
