A gardener is planning to plant flowers in a square-shaped flower bed. The cost to plant flowers per square foot is $3. If the perimeter of the flower bed is 40 feet, how much will it cost to plant flowers in the entire flower bed? Let's think step by step and output the final answer within \boxed{}.
user