{"raw_statement":[{"iden":"problem statement","content":"We have $N$ distinct points on a two-dimensional plane, numbered $1,2,\\ldots,N$. Point $i$ $(1 \\leq i \\leq N)$ has the coordinates $(x_i,y_i)$.\nHow many rectangles are there whose vertices are among the given points and whose edges are parallel to the $x$\\- or $y$\\-axis?"},{"iden":"constraints","content":"*   $4 \\leq N \\leq 2000$\n*   $0 \\leq x_i, y_i \\leq 10^9$\n*   $(x_i,y_i) \\neq (x_j,y_j)$ $(i \\neq j)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$x_1$ $y_1$\n$x_2$ $y_2$\n $ \\vdots $ \n$x_N$ $y_N$"},{"iden":"sample input 1","content":"6\n0 0\n0 1\n1 0\n1 1\n2 0\n2 1"},{"iden":"sample output 1","content":"3\n\nThere are three such rectangles:\nthe rectangle whose vertices are Points $1$, $2$, $3$, $4$,\nthe rectangle whose vertices are Points $1$, $2$, $5$, $6$,\nand the rectangle whose vertices are Points $3$, $4$, $5$, $6$."},{"iden":"sample input 2","content":"4\n0 1\n1 2\n2 3\n3 4"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"7\n0 1\n1 0\n2 0\n2 1\n2 2\n3 0\n3 2"},{"iden":"sample output 3","content":"1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}