A rectangle has a length of (x + 3) centimeters and a width of image x centimeters. If the perimeter is 24 centimeters, what is the length of the rectangle?