How to get the number of items (e.g. songs) in the Table of Contents?

Open the Table of Contents. Switch to the ‘multi select’ mode. Click the ‘Select all’ menu item. A toast shows the number of selected items.