Random sum of random variables

Say you sum i.i.d. variables $X_i$ a total of $Y$ times. If you know the distribution of random variables $Y$ and $X_i$, what is the calculation you have to do to get the distribution of the sum?


If $S=\sum_{i=1}^{Y}X_{i}$, then the cumulant generating function of $S$ satisfies $$K_S(t)=K_Y(K_X(t)).$$ Any property of $S$ can be extracted from $K_S$.