import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan = new Scanner(System.in); int steps = scan.nextInt(); int level = 0; boolean below = false; int valleys = 0; String step = scan.next(); for(int i = 0;i= 0){below = false;} break; case 'D':level = level - 1; if(!below && level < 0){ below = true; valleys = valleys + 1; break;} default: break; } } System.out.println(valleys); } }