In a couple of places we calculate the maximum number of cases to keep