To minimize the cost, you would want the side with the brick wall to be as small as possible. as you provided no restraints to the size, a garden which is 1 foot wide by 22 feet long would be most cost effective, with 22 feet times 2 sides equaling 44 feet in total, plus one foot for the back wall. With a total of 45 feet of fence costing $450, and 1 foot of brick which will cost $20, the total cost would be $470.