The lengths of the sides of a square are represented by the expression 3x + 1 cm. The perimeter of the square is 28 cm. What is the value of x