Given a convex polygon with $n$ vertices on a grid. Let $S$ be the set of grid points inside and on the boundary of this convex polygon. Find the number of ways to choose four distinct, unordered points $(x, y, z, w)$ from $S$ such that $x, y, z, w$ form a square.
Input
The first line contains an integer $n$.
The next $n$ lines each contain two non-negative integers $(x_i, y_i)$, representing the vertices of the convex polygon on the grid in clockwise order.
Output
Output a single integer representing the number of ways to choose four distinct, unordered points $(x, y, z, w)$ such that they form a square.
Examples
Input 1
5 0 0 0 2 1 2 2 1 2 0
Output 1
4
Input 2
3 0 0 0 100 100 0
Output 2
1473186
Input 3
4 0 100 100 200 200 100 100 0
Output 3
34001650
Subtasks
Subtask 1 ($10\%$): The input is a rectangle, and the first point is the bottom-left corner (the point with the minimum $x$ and $y$ coordinates).
Subtask 2 ($25\%$): The input is a right-angled triangle, the right angle is at the bottom-left, and the first point is the bottom-left corner (the point with the minimum $x$ and $y$ coordinates).
Subtask 3 ($15\%$): $n \le 8, 0 \le x_i, y_i \le 10$
Subtask 4 ($20\%$): $n \le 8, 0 \le x_i, y_i \le 300$
Subtask 5 ($15\%$): $n \le 8, 0 \le x_i, y_i \le 800$
Subtask 6 ($15\%$): $n \le 8, 0 \le x_i, y_i \le 2000$