------
## 最终结论
```python
def count_good_splits(s):
    left_count = [0] * len(s)
    right_count = [0] * len(s)
    
    # Initialize dictionaries to count distinct characters
    left_char_count = {}
    right_char_count = {}
    
    # Count distinct characters from left to right
    for i in range(len(s)):
        left_char_count[s[i]] = left_char_count.get(s[i], 0) + 1
        left_count[i] = len(left_char_count)
    
    # Count distinct characters from right to left
    for i in range(len(s) - 1, -1, -1):
        right_char_count[s[i]] = right_char_count.get(s[i], 0) + 1
        right_count[i] = len(right_char_count)

    # Calculate good splits
    good_splits = 0
    for i in range(len(s) - 1):  # We split between characters, hence len(s) - 1
        if left_count[i] == right_count[i + 1]:
            good_splits += 1

    return good_splits

# Example usage:
s = "aacaba"
print(count_good_splits(s))  # Output: 2

s2 = "abcd"
print(count_good_splits(s2))  # Output: 1

s3 = "aaaaa"
print(count_good_splits(s3))  # Output: 4

s4 = "acbadbaada"
print(count_good_splits(s4))  # Output: 2
```