A teacher has a total number of candies that, when divided among 8 students, leaves a remainder of 3. When the same number of candies is divided among 5 students, it leaves a remainder of 2. What is the smallest number of candies the teacher could have? Let's think step by step and output the final answer within \boxed{}.
user