#include using namespace std; int main(){ int n; cin >> n; vector ms(n,0); for(int i=0; i> ms[i]; int count = 0; set s; for(auto m : ms){ count += distance(s.lower_bound(m), s.end()); s.insert(m); } cout << count << endl; return 0; }