"Twenty-four trees are enough."
Translation:Dvacet čtyři stromů je dost.
If you add "trees" again to the end, you will get: "24 stromů je dost stromů" - there you have the genitive after "dost".
Syntax analysis: The first "24 stromů" is not dependent on "dost", it's a separate entity. In fact, "dvacet čtyři" is the subject, hence nominative. "stromů" depends on the subject and modifies it. And "dost" (together with the copula "je") is the predicate - same model as "František je muž." (X = Y).
You can actually view the entire "Dvacet čtyři stromů" as the subject.
Your "dvacet čtyři stromy" is also an alternative, but it follows a very confusing method of forming phrases with compound numbers. You can read about some of its pathologies here: https://forum.duolingo.com/comment/25815469. In short, avoid it like the plague.