This paper deals with the statistical inference in compound models, which are defined as a sum of i.i.d. random variables $ \xi _1+\cdots +\xi _N $ xi 1+& ctdot;+xi N, where the number of summands, N, is a random variable independent of $ \xi _1, \xi _2,\ldots $ xi 1,xi 2,& mldr; Using the novel technique based on the superposition of the Mellin and Laplace transforms, we construct a nonparametric estimator for the distribution of N, assuming that the distribution of xi is known explicitly. Unlike most papers on this topic, we consider the general setting, where the distribution of N is not necessarily of Poisson type.