toc: Correctly compute the max chapters.