A firm produces products X, Y and Z with contribution margins of $4, $5 and $10 respectively. The firm has only 5000 machine hours available for a particular period. Machine hours required for each of the products are 1, 1 and 5 hours respectively. Demand for the products is 1000 for X, 3000 for Y and 2000 for Z. How many units of product Z should be produced to maximize profit?