import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public static void main(string[]args) { int count=0, i, n, valley=0; String steps; Scanner scan = new Scanner(System.in); Scanner scan2 = new Scanner(System.in); do { n = scan.nextInt(); }while (n<2 || n>1000000); steps = scan2.nextLine(); for (i=0; i