How many words?

It is often said that the English language is particularly rich in vocabulary, but to make such a statement we need to know what words to count and what counts as a word.