How is the max number of allies you can have calculated?