#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int v=0,s=0,f=-1,n; cin>>n; string str; cin>>str; for(int i=0;str[i]!='\0';i++){ if(str[i]=='U') ++s; if(str[i]=='D') --s; if(s<0) f=0; if(s==0) { if(f==0) { ++v; f=-1; } } } cout<