Inflation hit 4 percent for the first time in three years in May, driven by surging gas prices from the Iran war.