using System; using System.Linq; public class P0116 { public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); var a = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList(); var result = 0; for(int i=0; i a[i] && a[i+1] > a[i+2] && a[i] != a[i+2]) { result += 1; } } Console.WriteLine(result); } }