#include // #include // NOTE: AtCoderライブラリ using namespace std; // using namespace atcoder; // NOTE: AtCoderライブラリ #define fi first #define se second #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--) #define dbg(x) cerr << #x << ": " << x << endl; #define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl; #define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl; #define nl() cout << "========================================" << endl; #define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn; typedef long long ll; typedef long double ld; typedef pair pii; typedef pair pll; typedef vector vi; typedef vector vl; typedef vector vb; typedef vector vc; typedef vector vs; typedef vector> vvi; typedef vector> vvl; typedef vector> vvb; typedef vector> vvc; typedef vector> vpii; typedef vector> vpll; const long long LINF = 1001002003004005006ll; const int INF = 1001001001; template void chmin(T &a, T b) { if (a > b) a = b; } template void chmax(T &a, T b) { if (a < b) a = b; } int main() { int N; cin >> N; vi A(N); rep(i, N) cin >> A[i]; int res = 0; int cnt = 0; rep(i, N - 1) { if (A[i] > A[i + 1]) { if (cnt == 0) cnt += 2; else cnt++; } else { res += cnt / 2; cnt = 0; } } res += cnt / 2; cout << (N - res) << endl; }