Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word.
A substring is a contiguous (non-empty) sequence of characters within a string.
Note: Due to the large constraints, the answer may not fit in a signed 32-bit integer. Please be careful during the calculations.
 
Please complete the following python code precisely:
```python
class Solution:
    def countVowels(self, word: str) -> int:
```