A simplified method for calculating the ac Stark shift of hyperfine levels of alkali-metal atoms