Bicycle Race

From Codeforces. Direction changes on polygon. Solve the geometry problem "Bicycle Race".

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

Bicycle Race

**From Codeforces.** Direction changes on polygon. Solve the geometry problem "Bicycle Race".