Perry spent 30$ on a magazine and some candy bars.If the magazine cost $6 and each candy bar cost $3 , then how many candy bars did he buy?