In the four-dimensional Cartesian coordinate system $Oxyzw$, there are $n$ points $P(x, y, z, w)$. You need to count how many pairs of points $P_i, P_j$ satisfy:
- $x_i < x_j$
- $y_i < y_j$
- $z_i < z_j$
- $w_i < w_j$
Input
The first line of input contains an integer $n$.
The next $n$ lines each contain $4$ integers $x, y, z, w$, representing the coordinates of the $i$-th point $P_i(x, y, z, w)$.
Output
Output a single integer representing the answer.
Subtasks
For all data, it is guaranteed that $x_i, y_i, z_i, w_i \in [1, n]$, no two points have the same coordinate in any dimension, and $1 \leq n \leq 10^5$.
Examples
Input 1
6 2 1 4 1 5 6 6 5 3 3 3 4 6 4 5 6 4 5 2 3 1 2 1 2
Output 1
9
Input 2
15 13 1 2 3 2 2 13 11 10 10 7 2 3 6 14 14 1 12 9 15 12 14 8 8 8 13 15 5 4 8 12 10 5 3 1 4 7 5 11 1 9 11 6 13 6 15 10 9 15 9 5 12 14 4 4 6 11 7 3 7
Output 2
15