Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.
{1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: It deals 1 damage to any target.
For example, if X is 4, Apocalypse Hydra enters the battlefield with four +1/+1 counters on it, but if X is 5, it enters the battlefield with ten +1/+1 counters on it.
The first ability checks the number you chose for X, not the amount of mana you actually spent.