#include #include #include #include #define every(iter,iterable) for(typeof((iterable).begin()) iter =iterable.begin();iter!=iterable.end();iter++) #include #include using namespace std; int main() { int n; cin>>n; string s; cin>>s; int check=0; int flag; int counter=0; if(s.at(0)=='U') { flag=1; counter=1; } else{ flag=0; counter=-1; } for(int i=1;i0) { flag=1; } else if(counter<0) { flag=0; } if(s.at(i)=='U') { counter++; } else{ counter--; } if(counter==0 && flag==0) { check++; } } cout<