#include <bits/stdc++.h>
using namespace std;
int l[100010], r[100010], v[100010], ans, n;
inline int read() {
  int x = 0, ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
  return x;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) v[i] = read();
  for (int i = 2; i <= n; i++) l[i] = v[i] > v[i - 1] ? l[i - 1] + 1 : 0;
  for (int i = n - 1; i >= 1; i--) r[i] = v[i] < v[i + 1] ? r[i + 1] + 1 : 0;
  ans = 1;
  for (int i = 2; i <= n - 1; i++) {
    if (v[i - 1] + 1 < v[i + 1])
      ans = max(ans, l[i - 1] + r[i + 1] + 3);
    else
      ans = max(ans, l[i - 1] + 2), ans = max(ans, r[i + 1] + 2);
  }
  if (n > 1) ans = max(ans, l[n - 1] + 2), ans = max(ans, r[2] + 2);
  cout << ans;
  return 0;
}
