We call a set of squares with sides parallel to the coordinate axes and vertices with integer coordinates friendly if any two of them have exactly two points in common. We consider friendly sets in which each of the squares has sides of length n. Determine the largest possible number of squares in such a friendly set. combinatoricslattice pointssquare latticelattice