Effect of the depth of formulas on their complexity