Tom is going to build a fence around his garden which is a rectangle measuring 8 m by 16 m. He will first put in posts which will be 4 m apart. If the posts cost $5 each, what will the total cost for all the posts?