3 hats cost a total of $18. Which equation describes the total cost. C, in terms of the number of hats, n?
A. C = 3n
B. C = 6n
C. C = 0.5n
D. 3C =n