The first side of a triangle is 3 cm longer than the second side. The third side is 4 shorter than twice the second side. The perimeter is 31 cm. How long is the first side?