calculating total_words for given page