Added 2 minutes later
The number of flipped cards the magician has will be 20 minus the number of flipped cards the spectator has. And since the spectator gives him 20 cards, after he flips all of them, the number of flipped cards he has will be:
20-(20-Qspectator's cards)=Qspectator's cards