A group of 40 children attended a baseball game on a field trip. Each child received either a hot dog or a bag of popcorn. Hot dogs were $2.25 and popcorn was $1.75. If the total bill was $83.50, how many hot dogs and bags of popcorn were purchased?