#include #include using namespace std; int main() { cin.tie(nullptr)->sync_with_stdio(false); int N; cin >> N; vector A(N); for (auto &a : A) cin >> a; int r = 0; while (r + 1 < N and A.at(r) >= A.at(r + 1)) ++r; int l = r; while (l > 0 and A.at(l - 1) == A.at(r)) --l; cout << r - l + 1 << '\n'; }