#include #include #include #include #include using namespace std; #define SEALEVEL 0 int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ bool inValley = false; int height = SEALEVEL; int N; int count = 0; string steps; cin>>N>>steps; for (int i = 0; i < N; i++) { if (steps[i] == 'U') { height++; if (inValley && (height == SEALEVEL)) { inValley = false; count++; } } else { if (height == SEALEVEL) { inValley = true;} height--; } } cout<