Maximizing Profit question

This one is giving me some trouble. Can you help me find the solution?

I will be paid 5$ for every every book I bring to a man. I will be paid an extra $1 per book per box if I bring them in a box.

It will take me 300 minutes to find 1000 books. It will take me 500 minutes to find 1 box.

I have a given number of minutes to return. What is the best strategy to take in order to earn the most?

What I can figure out so far:

let x be the number of books and y be the number of boxes.

Profit = x * ($5 + $1 * y)

Time = 300(x/1000) + 500y

How do I put the two of these together to figure out the max?