Cut the Triangle

From Codeforces. Axis-aligned triangle classification. Solve the geometry problem "Cut the Triangle".

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

Cut the Triangle

**From Codeforces.** Axis-aligned triangle classification. Solve the geometry problem "Cut the Triangle".