Okay, let us consult the "Book of Armaments."
Sorry, Monty Python came to mind...
The IDPA rules book states, 'A maximum of two (2) spare magazines carried in 2 single pouches or 1 double pouch or three (3) speedloaders may be worn at any time. One additional magazine may be carried on the person for "charging" purposes only.'
So, you should have 3 of them. That being said, I'd have a few more just in case. You may not be able to carry more during a string of fire, but it will cut down on reloading time, save the springs, whatever.
In addition, I'd have a few extra just for the Classifier. You know, the parts where you have to load just a few reounds in the magazine for a slide-lock reload... (string 6 of Stage 1 and string 3 of Stage 2).
And while we're at it, you might even want a few magazines dedicated to practice 'reload with retention.' But that might be pushing it.
Best of luck for your shooting!