In such question of distribution which involves identical objects to different boxes , the solution is nothing but similar to number of non negative integral solutions of the equations.In this case it will be :
x1 + x2 + x3 = 5 so n = 3 , r = 5 ..So
No of ways of distribution = No of non negative solutions
= n-1+rCr
= 3-1+5C5
= 7C5
= 21
Hence 21 is the number of ways of distribution..