Solve third exercise