A 30" x 30" square metal plate needs to be fixed by a carpenter on to a wooden board. The carpenter uses nails all along the edges of the square such that there are 31 nails on each side of the square. Each nail is at the same distance from the neighboring nails.

How many nails does the carpenter use?