A 40x40 white squareis divided into 1x1 squares by lines parallel to its sides. Some of these 1x1 squares are coloured red so that each of the 1x1 squares, regardless of whether it is coloured red or not, shares a side with at most one red square (not counting itself).
What is the largest possible number of red squares?