From my (beginner's) understanding, most of the time, choosing the right case to use for a word is a straightforward process: after много, use the genitive, etc.
However, sometimes there can be conflicting applicable rules. Let's imagine I want to say: "sorry for the five mistakes":
- извини за should be followed by an accusative
- пять should be followed by a genitive plural
So in the sentence "извини за пять [ошибка]", what case should I use for ошибка? Accusative, or genitive plural?
And what kind of logic governs the choice between those conflicting rules? Does each rule have some intrinsic priority, e.g. the "пять" (or any similar number) rule is always more important than the "извини за" rule? Or does it depend on the order of words, e.g. the "пять" rule takes precedence in this specific sentence because пять comes last?
Lastly, do you know whether there's any name for this kind of situation? I couldn't find it anywhere in my grammar book, nor on a search engine, but I might just be missing the proper keywords. Or did I make up a problem that doesn't actually exist?