Problem 34

Python 2.7