Draw three cards, then put two cards from your hand on top of your library in any order.
You draw three cards and put two cards back all while Brainstorm is resolving. Nothing can happen between the two, and no player may choose to take actions.