US July CPI cools to 3.4% as core inflation hits 2.5%