Let x be the length of one side of one of the squares you have to cut off.

Then you get:

......... Expand the brackets. You'll get aquadratic equation:

......... Solve this equation for x. Only one of the two solutions is valid with your problem.

(For confirmation only: x = 5)