Cow Steeplechase

From USACO. Shape / Geometry. Solve the geometry problem "Cow Steeplechase".

Examples
Input: [13,18,20,18,22,10,22,9,24,5,16,5,18,8,18,27,5,20,13,20,13,30,13,10]
Output: 2
Hints

Cow Steeplechase

**From USACO.** Shape / Geometry. Solve the geometry problem "Cow Steeplechase".