#include "stdinc.h"

int inversions(int*,int*,int,int);
//int inversions(int A[], int B[], int l, int r);

int main()
{
   int   i,
         n,
         *A,
         *B;
   cin >> n;

   A = new int[n];
   B = new int[n];
   for (i=1; i<=n; i++)
      cin >> A[i-1];

   cout << "There are " << inversions(A,B,0,n-1) << " inversions" << endl;

   return(1);

}
   

