```python
def number_of_substrings(s):
    """
    Counts the number of non-empty substrings of a given string.

    Args:
        s: The input string.

    Returns:
        The total number of non-empty substrings.
    """
    string_length = len(s)
    # The number of substrings in a string of length n is the sum of integers from 1 to n,
    # which is given by the formula n * (n + 1) / 2.
    # Each character can be the start of a certain number of substrings.
    # The first character starts n substrings.
    # The second character starts n-1 substrings.
    # ...
    # The last character starts 1 substring.
    # Total = n + (n-1) + ... + 1 = n * (n + 1) / 2
    return string_length * (string_length + 1) // 2

```