I'm pretty new but have read that the reason you should have more females is because it helps the aggression be "diluted" between the individuals and therefore no one is "picked on" and stressed by over-aggression.
As for the number, I'll leave that to someone who knows more!
A 10 Gal tank is the minimum recommended tank size for a sorority. I have 5 girls in my 10G. I have heard you can have up to 6 in that size but I would go no higher. And of course that is with no other tank mates. The aggression is spread out and each fish has room to set up their own "territories".
10 Gallon Tank:
~Countless Pond Snails~1 Espe's Rasbora~1 Harlequin Rasbora~ 5 and 5.5 Gallon Tanks:
Avatar by Fenghuang
Many of my scaly friends from my original tank from 2011 have passed, except for two! I am in the process of re-doing my tank. :)