Besides the actual logic to solve this problem (which is that every ball has 3 choices) i am giving you a short cut to remember the result. In case of distinct items going into distinct places, the result can be generalized as (where)^what. In our case what is going where? Ball (what) is going in to boxes (where). Hence 3^5.