John purchased three bonds to form a portfolio as follows: Bond A has semi-annual coupons at 4%, a duration of 21.46 years, and was purchased for 980. Bond B is a 15-year bond with a duration of 12.35 years and was purchased for 1015. Bond C has a duration of the 16.67 years and was purchased for 1000. Calculate the duration of the portfolio at the time of purchase.