The area of a rectangular R with width 4 feet is equal to the area of a square S which has a perimeter of 24 feet. The perimeter of the rectangular R, in feet, is :