Write a square-counting program
Python, 95

Takes a list of coordinates from stdin.

l=input();print(sum((c-d+b,d+c-a)in l and(a-d+b,b+c-a)in l for a,b in l for c,d in l)-len(l))/4


Explanation:


   For each pair of points (a,b) and (c,d), check if the square with additional points (c-d+b,d+c-a) and (a-d+b,b+c-a) is in the list.  This counts each square 4 times, and each point once (when (a,b) = (c,d)), so subtracting the number of points and dividing by 4 gives the number of squares.