solve problem #3