The first side of a triangle measures 5 inches less than the second side. The third side is 3 inches more than the first side. The perimeter of the triangle is 17 inches. What is the length of the second side?