Optimized word count. Scales with O(1) regardless of filelenght and number of files specified.