If put onto the battlefield without casting it from your hand, X will be zero.

Artwork
Loading artwork…
Rock Hydra
30th Anniversary Edition · #167 · EN
Nonfoil—Foil—
Card rules
This creature enters with X +1/+1 counters on it.
For each 1 damage that would be dealt to this creature, if it has a +1/+1 counter on it, remove a +1/+1 counter from it and prevent that 1 damage.
: Prevent the next 1 damage that would be dealt to this creature this turn.


: Put a +1/+1 counter on this creature. Activate only during your upkeep.
0/0
Rare · Illustrated by Jeff A. Menges
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Once on the battlefield, the X is considered to be zero when calculating its mana cost.
If damage that would be dealt to Rock Hydra can't be prevented, you still remove a +1/+1 counter from it for each 1 damage dealt.
You can activate the activated ability that prevents damage any time, even if no source seems likely to deal damage to you in the near future. It will prevent the next 1 damage that would be dealt this turn, even if that turns out to be much later in the turn.