The school cafeteria charges $2 for a hot dog and $4 for a hamburger. If the cafeteria earned $100 selling 40 lunches, how many hot dogs were purchased?