The sample size based on the Linex loss function and Blinex loss function is studied in this paper, and the analytical solution of the optimal sample size is deduced on the assumption that the Linex loss function and the normal distribution exist. For the Blinex loss function, an accurate algorithm was presented to obtain the optimal sample size. Furthermore, the optimal sample size is obtained, respectively, by taking Poisson distribution and normal distribution as examples. Due to the wide application of Blinex function in reality, the algorithm presented in this paper has immediate applications.