How to calculate the inflation rate for a year