A company makes two types of calculators, one that uses batteries and one that is solar powered. The production of each battery operated calculator involves 1 hour on Machine A, 2 hours on Machine B, and 1 hour on Machine C. The production of each solar powered calculator involves 2 hours on Machine A, 1 hour on Machine B, and 1 hour on Machine C. The company can use Machine A for a total of 14 hours, Machine B for a total of 17 hours, and Machine C for a total of 9 hours. If the company can earn a profit of $2 for each battery powered calculator and $6 for each solar powered calculator, how many of each should it produce in order to maximize profit? What is the maximum profit it can earn?