Solve problem 104 using Python.