#include<stdio.h>
#define MAX 200001
int main(){
int n,i,j;
int A[MAX];
int cnt=0;

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



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;
}
