An economical scheme for numerical integrating the system of differential equations has been proposed for the model of a multiphase medium with a common pressure (in the barotropic approximation) in liquids. The algorithm allows us to consider an arbitrary number of liquids and admits the possibility of degeneration of this parameter to one liquid in the calculation process. The equations of states for liquids have no restriction related to the finite compressibility of the medium, i.e. the liquid can be incompressible. An implicit method for generating a solution is used. The efficiency is ensured by the fact that the algorithm for constructing the inverse matrix is based on the splitting scheme for physical processes and the solvability of equations within scalar runs. As an example, the flow variant for three liquids is considered.