Goma has recently developed a newfound interest in mountain climbing and is traveling from left to right through a path of length $$$N$$$ with altitudes assigned to each point. Your task is to determine the number of mountains that Goma will climb during their journey. A mountain is defined as three or more consecutive points with strictly increasing altitudes. It is important to note that if there are more than three points with strictly increasing altitudes, they should be considered as a single mountain. For example, if $$$[l, r]$$$ is a mountain, $$$[l, r-1]$$$ should not be considered as a separate mountain.
The first line contains the integer $$$N$$$ ($$$3 \leq N \leq 10^3$$$), specifying the length of the path Goma will take.
The next line contains $$$N$$$ integers $$$a_1, a_2,\dots, a_N$$$ ($$$1 \leq a_i \leq 10^3$$$) denoting the altitudes of each point of the path.
A single integer denoting the number of mountains Goma will climb.
11 1 2 3 2 4 4 1 4 5 7 3
2
The two mountains here are from points $$$1$$$ to $$$3$$$ with altitudes $$$1, 2, 3$$$ and points $$$7$$$ to $$$10$$$ with altitudes $$$1, 4, 5, 7$$$.
—
Idea: Codicon
Preparation: Bossologist
Occurrences: Novice 2