#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin >> n; int lev = 0; int v = 0; bool down = false; for(int i=0;i> c; if(c=='U'){ lev++; if(lev==0){ v++; } }else{ lev--; } } cout << v << endl; return 0; }