The optimal number of carboniferous series and stages