Stacy put a fence around a rectangular flower bed with a length of 18ft and a width of 4.5 ft. Next, he enclosed a square flower bed that had the same area. What number fo feet of fence did he need to enclose the entire square flower bed?