Started solving the third problem