counts all words in a .txt file given as input