// Enter your code here let NumberOdCandles = Int(readLine()!)! let candlesHeightArray = readLine()!.characters.split(" ").map{Int(String($0))!} var count = 0 for row in 0...candlesHeightArray.count-3 { if row == 0 { if candlesHeightArray[row] > candlesHeightArray[row+1] { count = count + 1 } else if candlesHeightArray[row+1] > candlesHeightArray[row+2] { count = count + 1 } } else { if candlesHeightArray[row+1] > candlesHeightArray[row] && candlesHeightArray[row+1] > candlesHeightArray[row+2] { count = count + 1 } else if row == candlesHeightArray.count-3 && candlesHeightArray[row+1] > candlesHeightArray[row] { count = count + 1 } else if row == candlesHeightArray.count-3 && candlesHeightArray[row+2] > candlesHeightArray[row+1] { count = count + 1 } } } print(count)