#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	const int HEIGHT = N;
	for(int i = 0; i < N; i++){
		cin >> HEIGHT[i];
	}
	int ans = 0;
	for (i = 0; i < N; i++) {
		for (int j = i - 1; j = 0; j--;) {
			if (HEIGHT[i] >= HEIGHT[j]) {
				ans++;
			}
			else {
				break;
			}
		}
	}

	cout << ans << endl;
	return 0;