Nonperturbative method of calculation of functional integrals