Count Number of Trapezoids I

From LeetCode. Counting horizontal trapezoids. Solve the geometry problem "Count Number of Trapezoids I".

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

Count Number of Trapezoids I

**From LeetCode.** Counting horizontal trapezoids. Solve the geometry problem "Count Number of Trapezoids I".