Calculating the total hours