I am having some trouble on an optimization problem that I have for my homework assignment. It reads

Assume that if the price of a certain book is p dollars, then it will sell x copies where x = 7000(1-p/35). Suppose the dollar cost of producing those x copies is 15000 + 2.5x. Finally assume that the company will not sell th book for more than $35. Determine the price of the book that will maximize profit.

I know that revenue is equal to number of units sold multiplied by the price per unit.

R = n x p

I do not know how to approach the problem though. Should I start by solving for p in the equation x = 7000(1-p/35)?