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 scanner = new Scanner(System.in); int N = 0; String str = null; if(scanner.hasNextInt()){ N = scanner.nextInt(); }else{ System.exit(0); } if(scanner.hasNext()){ str = scanner.next(); }else{ System.exit(0); } char[] steps = str.toCharArray(); int currentLevel = 0; int noOfValleys = 0; for(int i=0;i