For a student to qualify, he must pass at least two out of three exams. The probability that he will pass the 1st exam is p. If he fails in one of the exams, then the probabiliy of his passing in the next exam is p2, otherwise it remains the same. Then the probability that he will qualify, is