import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { int count=0, i, n, valley=0; String steps; Scanner scan = new Scanner(System.in); do { n = scan.nextInt(); }while (n>=2 && n<=Math.pow(10,6)); steps = scan.nextLine(); for (i=0; i