def count_type_changes(pattern: str):
    """Count the number of type changes in the given pattern.

    The pattern is expected to describe Bloch points with single characters
    where each character type represents one type of Bloch point. Example:
    `iooi` -> two type changes.
    """
    count = 0
    for left, right in zip(pattern[:-1], pattern[1:]):
        if left != right:
            count += 1
    return count