#include <stdio.h>

#define MAX 200000
int A[MAX] = {0};

int main(void)
{
	int n, i, j, cnt;
	scanf("%d", &n);

	for (i = 0; i < n; ++i) {
		scanf(" %d", &A[i]);
	}

	cnt = 0;
	for (i = 0; i < n - 1; ++i) {
		for (j = i+1; j < n; ++j) {
			if (A[i] > A[j]) ++cnt;
		}
	}
	printf("%d\n", cnt);
	
	return 0;
}
	