#include <bits/stdc++.h>
using namespace std;
int N, A[100];
int W[100];
int merge_and_count(int l, int r) {
  if (l + 1 >= r) return 0;
  if (l + 2 == r) {
    if (A[l] <= A[l + 1]) return 0;
    swap(A[l], A[l + 1]);
    return 1;
  }
  int m = (l + r) / 2;
  int cl = merge_and_count(l, m);
  int cr = merge_and_count(m, r);
  int c = 0;
  int i = 1, j = m;
  int k = 1;
  while (i < m && j < r) {
    if (A[i] <= A[j])
      W[k++] = A[i++];
    else {
      W[k++] = A[j++];
      c += j - i - 1;
    }
  }
  while (i < m) W[k++] = A[i++];
  while (j < r) W[k++] = A[j++];
  assert(k == r);
  return cl + cr + c;
}
int main() {
  cin >> N;
  for (int n = 0; n < N; n++) {
    cin >> A[n];
  }
  cout << merge_and_count(0, N) << endl;
}
