Mister Smith wants to put a small fence around his garden. A store sells three feet sections of fence at cost of $5.49 per section. In the number of feet, what is the longest length of fence can he purchase if he wants to spend less than 145 dollars on the fence? Assume Mister Smith cannot purchase a fraction of a section of fencing and must purchase only whole sections. Show work and explain your reasoning.