#include using namespace std; /* ???????????????????????????????? =>?45? ???????????????????????????? ????????? ??? */ #define N 200005 int n,a[N]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>n; long long ans=0,up=0; for(int i=1;i<=n;i++){ cin>>a[i]; if(i>1){ if(a[i]>a[i-1])up++; else ans+=up; } } cout<