Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors, where X is that spell's mana value.
If the countered spell had {X} in its mana cost, include the value chosen for that X when determining how much mana to add to your pool. For example, if you counter a spell that costs {X}{R} with X equal to 5, you’ll add six mana to your mana pool.
Your precombat main phase is the main phase that happens immediately after your draw step, not any other main phase.