#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1198
Task: _ohn

</think>

Write a Python function that takes a string and returns the number of distinct anagram groups formed by splitting the string into substrings of consecutive vowels and consonants, where
Generated: 2026-02-12T23:51:45.153882
"""

import re
from collections import defaultdict

def count_anagram_groups(s):
    # Split string into groups of consecutive vowels and consonants
    groups = re.findall(r'[aeiou]+|[^aeiou]+', s)
    
    # For each group, sort the characters and use as key for anagram groups
    anagram_map = defaultdict(int)
    for group in groups:
        # Sort the characters in the group to form an anagram key
        sorted_group = ''.join(sorted(group))
        anagram_map[sorted_group] += 1
    
    # The number of distinct anagram groups is the number of keys in the map
    return len(anagram_map)

if __name__ == '__main__':
    test_string = "aeioubcdfg"
    result = count_anagram_groups(test_string)
    print(result)