CF425D Sereja and Squares

Description

Sereja has painted $ n $ distinct points on the plane. The coordinates of each point are integers. Now he is wondering: how many squares are there with sides parallel to the coordinate axes and with points painted in all its four vertexes? Help him, calculate this number.

Input Format

The first line contains integer $ n $ $ (1

Output Format

In a single line print the required number of squares.