Martin and Edward are neighbors. Martin has a rectangular backyard whose length is 12 feet and whose width is 6 feet. Edward's backyard is a square that shares a side of Martin's backyard (the width). The men decide to line each side of both yards with hedges. At the end of the gardening project, how many feet of hedges have Martin and Edward laid?