How can I determine the current brew package count?
On June 23, 2019 the soon to be incorrect count of packages is 4804.

Since many people add and remove packages, this count shifts by dozens a day and sometimes hundreds at a time when larger changes move packages out of the mainstream repository into a sub repository that can be "tapped" to increase the count.

Homebrew uses a concept called tap, which is simply a repository containing a list of formulae that it tracks, updates, and installs from. The default installation of Homebrew comes with a tap called homebrew/core but there's no limit to how many or how large a tap you could source packages since they can be self hosted pretty much anywhere.

Running brew [command] [options] runs the command on homebrew/core tap. There are various other official and unofficial taps from which packages can be installed.

The total count of packages in any tap keeps changing as new packages (called formula) are added, deleted or updated. To get the current count, first update the local homebrew/core tap repository by running:

brew update.

Now execute your command-line:

brew search | wc -l

to get the current count of packages in the homebrew/core tap. Running brew search without any arguments lists all the packages (formula).