#include #include using namespace std; int main(){ int n; cin>>n; vector a(n); int c=0; for(int i=0;ia[i+2]&&a[i]!=a[i+1])||(a[i]>a[i+1]&&a[i+1]