Problem 1 solution. Did not use functions at all for such a short solution.