A math teacher drove by a playground that was full of boys and dogs. The teacher happened to notice that there was a total of 40 heads and 100 feet. How many boys and how many dogs were there?