//#include #include using namespace std; #define int long long #define rep(i,s,n) for(int i = s;i=(s);i--) #define all(v) (v).begin(),(v).end() #define pb push_back #define fi first #define se second typedef long long ll; typedef pairpint; typedef vectorvint; typedef vectorvpint; typedef pair P1; typedef pair P2; static const ll maxLL = (ll)1 << 62; const ll MOD=1000000007,INF=1e18; int dy[]={-1,0,1,0}; int dx[]={0,1,0,-1};*/ int n,a[100010]; signed main(){ cin>>n; rep(i,0,n){ cin>>a[i]; } int ans=0; rep(i,0,n-1)rep(j,i+1,n){ if(a[i]>a[j])ans++; } cout<