#include <bits/stdc++.h>   using namespace std;   bool comp(long long x, long long y) {     if (x >= y) return true;     return false;   }   bool compare(const pair<long long, long long> &i,                const pair<long long, long long> &j) {     return i.first <= j.first;   }   bool compare1(const pair<long long, long long> &i,                 const pair<long long, long long> &j) {     return i.first > j.first;   }   string decitobinary(long long n, long long bit) {     char c[bit];     memset(c,  0 , sizeof(c));     long long i = 0;     while (n > 0) {       c[i] = n % 2 + 48;       n = n / 2;       i++;     }     string s =   ;     for (long long j = bit - 1; j >= 0; j--) s += c[j];     return s;   }   long long binarytodeci(string n) {     string num = n;     long long dec_value = 0;     long long base = 1;     long long len = num.length();     for (long long i = len - 1; i >= 0; i--) {       if (num[i] ==  1 ) dec_value += base;       base = base * 2;     }     return dec_value;   }   long double intlog(long double base, long double x) {     return (log(x) / log(base));   }   long long fact(long long n) {     long long res = 1;     for (long long i = 2; i <= n; i++) res = res * i;     return res;   }   long long ncr(long long n, long long k) {     long long res = 1;     if (k > n - k) k = n - k;     for (long long i = 0; i < k; ++i) {       res *= (n - i);       res /= (i + 1);     }     return res;   }   bool ispalindrome(string str, long long l, long long h) {     while (h > l) {       if (str[l++] != str[h--]) return 0;     }     return 1;   }   long long compute_hash(string s) {     long long p = 31, hash = 0, po = 1;     for (char c : s) {       hash += (c -  a  + 1) * po % 1000000007;       po = (po * p) % 1000000007;     }     return hash;   }   vector<vector<long long>> group_identical_strings(vector<string> const &s) {     long long n = s.size();     vector<pair<long long, long long>> hashes(n);     for (long long i = 0; i < n; i++) hashes[i] = {compute_hash(s[i]), i};     sort(hashes.begin(), hashes.end());     vector<vector<long long>> groups;     for (long long i = 0; i < n; i++) {       if (i == 0 || hashes[i].first != hashes[i - 1].first) groups.emplace_back();       groups.back().push_back(hashes[i].second);     }     return groups;   }   bool isarraysort(long long a[], long long i, long long j) {     if (j == i) return 1;     if (a[j] < a[j - 1]) return 0;     return isarraysort(a, i, j - 1);   }   void sieve(long long n, long long prime[]) {     for (long long i = 1; i <= n; i++) prime[i] = 1;     for (long long p = 2; p * p <= n; p++) {       if (prime[p] == 1) {         for (long long i = p * p; i <= n; i += p) prime[i] = 0;       }     }   }   bool isprime(long long n) {     for (long long i = 2; i * i <= n; i++) {       if (n % i == 0) return 0;     }     return 1;   }   long long pow_mod(long long base, long long exp) {     long long res = 1;     while (exp > 0) {       if (exp % 2 == 1) res = (res * base) % 1000000007;       exp = exp >> 1;       base = (base * base) % 1000000007;     }     return res;   }   const long long N = 1e6 + 3;   vector<vector<long long>> adj;   bool visited[N];   long long depth[N] = {0};   long long size[N] = {0};   long long parent[N];   void dfs(long long v) {     visited[v] = true;     for (long long u : adj[v]) {       if (!visited[u]) {         dfs(u);       }     }   }   long long time_in[N], time_out[N];   long long dfs_timer = 0;   long long color[N];   void dfs_time(long long v) {     time_in[v] = ++dfs_timer;     color[v] = 1;     for (long long u : adj[v]) {       if (color[u] == 0) {         dfs_time(u);       }     }     color[v] = 2;     time_out[v] = ++dfs_timer;   }   long long count1[N];   void numberOfNodes(long long s) {     count1[s] = 1;     for (long long u : adj[s]) {       if (u == parent[s]) continue;       numberOfNodes(u);       count1[s] += count1[u];     }   }   void solve() {     long long n;     cin >> n;     long long a[n];     for (long long i = 0; i < n; i++) cin >> a[i];     long long r[n], l[n];     for (long long i = 0; i < n; i++) {       r[i] = 1;       l[i] = 1;     }     for (long long i = 1; i < n; i++) {       if (a[i] > a[i - 1]) r[i] = r[i - 1] + 1;     }     for (long long i = n - 2; i >= 0; i--) {       if (a[i] < a[i + 1]) l[i] = l[i + 1] + 1;     }     long long mx = r[0];     for (long long i = 1; i < n; i++)       if (r[i] > mx) mx = r[i];     long long ans[n];     for (long long i = 0; i < n; i++) ans[i] = 0;     for (long long i = 1; i < n - 1; i++) {       if (a[i - 1] < a[i + 1]) ans[i] = r[i - 1] + l[i + 1];     }     sort(ans, ans + n);     cout << max(mx, ans[n - 1]);   }   int32_t main(void) {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long t = 1;     while (t--) {       solve();     }   }