Alex bought a set of 4 books and a pen. The total cost of the books was $36. The total amount paid for the books and the pen was $40. How much did the pen cost? Let's think step by step and output the final answer within \boxed{}.
user