#include using namespace std; using ll=long long; int main(){ int N; cin>>N; vector P(N); for(int i=0;i>P[i]; } int ans=0; for(int i=0;iP[i]) ans+=i+1; else if(i+1