From certain number of apples, a man sells \( \frac{1}{3} \) of the apples to the first customer. He sells \( \frac{1}{2} \) of the remaining apples to the second customer, and \( \frac{1}{3} \) of the remaining apples plus 5 to the third customer. He then finds himself left with 3 apples. How many apples did the man have initially?