Others have commented on built-in vim functionality for counting words, but assuming the author copy-pasted a similar looking command, they may have intended something like:
:%s/\w\+//gn
Knowing that the n flag will return a count instead of doing the substitute may be useful to know, but I personally don't need a search count very often.Knowing that you can execute a vimscript expression on each search match using \= is also cool and I was unaware of such functionality. https://vimhelp.org/change.txt.html#sub-replace-expression