#include using namespace std; using ll=long long; int main(){ int N; cin>>N; vector A(N); for(int i=0;i>A[i]; } int ans=0; for(int L=0;L mp; mp[A[L]]++; for(int R=L+1;R