Counting non-negative integral solutions
Number of non-negative integral solutions of equation x1+x2+⋯+xn=k
= Number of ways in which k identical balls can be distributed into n distinct boxes
(k+n-1)C(n-1)
here let x=p+2;y=q+3;z=r+4;
so we get p+q+r=17-9=8;
k=8, n=3 we get 10C2=45