Counting the words in a latex document can sometimes be a troublesome task because of all the LaTeX coding in a document. However there is a simple tool which strips the document from all its LaTeX code, untex. It is a simple command line tool which can be installed from the Ubuntu repositories.
apt-get install untex
In order to count the words simply run:
$ untex document.tex |wc -w
998