A manager is comparing the cost of buying baseball caps from two different companies.

- Company X charges a $50 fee plus $7 per baseball cap.

- Company Y charges a $30 fee plus $9 per baseball cap.

For what number of baseball caps will the cost be the same at both companies?
A. 20
B. 100
C. 40
D. 10