Algorithm for finding the optimal size of the resource of the shop, the demand for which is an inquiry random variable. The distribution of the law of demand on the basis of statistical data and the mathematical wait of which is a dim triangular number.