Formalizing problem 5.