solve problem 13 in python
solve 14 in python