This paper proposes a new approach to calculate the time spent by unmanned aerial vehicle (UAV) in dangerous area with the consideration of the maximum allowed probability of losing UAV and the increasing rate of this probability in a given area. Unlike the known approaches, which are based on flying around the dangerous areas, it is proposed to cross the boundaries of the dangerous area for a defined time, which is calculated to allow the obtaining of the required data set about the interested area. Based on the UAV loss probabilities estimates, an approach to planning the number of UAVs in a group flight is substantiated, taking into account losing them. The formula for calculating the required number of UAVs, obtained by this approach, consists of three terms, which consider the requirements for pre-flight task accomplishment, high-quality in-flight service of new requests, as well as the necessary reserve in case of the decrease of UAV performance. To evaluate the quality of the proposed algorithm, various case with different initial conditions in determining the time of stay in dangerous zone are considered. The specified time minimizes the given indicator. In addition, the paper presents practical example where the algorithm is used to observe a territory by a group of UAVs. It is shown that the algorithm can determine the required number of UAVs to study an area with a given dimension, and it also can calculate the time of stay of each UAV in the dangerous area in order to reduce the loss probability of UAVs.