Solve third task from kata-1