#include <bits/stdc++.h>
long long bigmod(long long sonkha, long long ghat, long long vag_const) {
  long long vag_shesh = 1;
  while (ghat > 0) {
    if (ghat % 2 == 1) {
      vag_shesh = (vag_shesh * sonkha) % vag_const;
    }
    ghat /= 2;
    sonkha = (sonkha * sonkha) % vag_const;
  }
  return vag_shesh;
}
long long inverse_mod(long long bivajok, long long vag_const) {
  return bigmod(bivajok, vag_const - 2, vag_const);
}
using namespace std;
vector<int> v[100005];
int main() {
  int t, m, cas = 1, k = -1, pre = -1, mx = 1, cnt = 0, n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pre = k;
    scanf("%d", &k);
    if (k > pre)
      v[cnt].push_back(k);
    else
      v[++cnt].push_back(k);
  }
  for (int i = 0; i <= cnt; i++) {
    if (v[i].size() == 1) {
      mx = max(mx, (int)(v[i].size() + v[i + 1].size()));
      if (i) mx = max(mx, (int)(v[i].size() + v[i - 1].size()));
    } else if (v[i].size() && v[i + 1].size()) {
      if (v[i + 1][0] - v[i][v[i].size() - 2] >= 2) {
        mx = max(mx, (int)(v[i].size() + v[i + 1].size()));
      } else if (v[i + 1].size() >= 2) {
        if (v[i + 1][1] - v[i][v[i].size() - 1] >= 2) {
          mx = max(mx, (int)(v[i].size() + v[i + 1].size()));
        }
      }
    }
    mx = max(mx, min((int)v[i].size() + 1, n));
  }
  printf("%d", mx);
  return 0;
}
