For a rectangle, you have two pairs of equal sides.
So for 27, you have x+4+x+4+x+x=60.
You can simplify to 4x+8=60.
Now subtract 8 from both sides, so you have 4x=52.
Divide both sides by 4 to get x by itself. This works because 4/4=1, and 1x just equals x. Your answer is x=13.