The consumer price index rose 3.5% in June from a year earlier, a deceleration after several months of upward moves.