include

include

using namespace std;
typedef long long ll;

const int MAXN = 210 * 2;
const int SHIFT = 102;
ll bit[MAXN];

void bitAdd(int x, int v) {
while (x < MAXN) {
bit[x] += v;
x += (x & (-x));
}
}

ll bitSum(int x) {
ll sum = 0;
while (x > 0) {
sum += bit[x];
x -= (x & (-x));
}
return sum;
}

int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);

int N; cin >> N;
ll ans = 0;
memset(bit, 0, sizeof(bit));
for (int i = 0; i < N; ++i) {
    int t; cin >> t; t += SHIFT;
    ans += bitSum(t);
    bitAdd(t, t - SHIFT);
}
cout << ans << "\n";

}