Bicycle Race

Maria rides around Lake Lucerne on a closed track that repeats the shoreline. The shore consists only of horizontal and vertical segments. The track has n straight sections and is given as n + 1 points: section i runs from points[i] to points[i + 1], and the last point equals the first.

The race starts at the southernmost point of the track, breaking ties by the westernmost point, and the riders move north. At a vertex Maria considers the turn dangerous when ignoring the turn puts her immediately into the water, that is, when continuing straight along the incoming section enters the lake. The lake is the region inside the simple closed track.

For these constraints the riders traverse the track clockwise with the water on their right. A convex vertex is a right turn, and continuing straight there leaves the lake. A reflex vertex is a left turn, and continuing straight there stays in the lake. Therefore a dangerous turn is exactly a left turn, equivalently a reflex vertex, and the answer is the number of left turns.

Examples
Input: [1,2,3]
Output: 0
Hints

Bicycle Race

Maria rides around Lake Lucerne on a closed track that repeats the shoreline. The shore consists only of horizontal and vertical segments. The track has `n` straight sections and is given as `n + 1` points: section `i` runs from `points[i]` to `points[i + 1]`, and the last point equals the first.