#include <iostream>
#include<vector>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> height;
	for(int i = 0; i < N; i++){
		cin >> height[i];
	}
	int ans = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i; j <= ; j++) {
			if (height[i] >= height[j]) {
				ans++;
			}
		}
	}

	cout << ans << endl;
	return 0;
	}
