The consumer price index shows prices climbed 3% in June compared to a year ago, better than expected.