Samantha went to the grocery store and purchased cans of soup and frozen dinners. Each can of soup has 350 mg of sodium and each frozen dinner has 700 mg of sodium. Samantha purchased a total of 9 cans of soup and frozen dinners which collectively contain 3850 mg of sodium. Determine the number of cans of soup purchased and the number of frozen dinners purchased.