Predicting group size in primates: foraging costs and predation risks