input: def balanced_substrings_count(s: str) -> int:
      """
      Given a string s, your task is to divide it into one or more balanced substrings. For example, if s == "ababcc" then ("abab", "c", "c"), ("ab", "abc", "c"), and ("ababcc") are valid divisions, but ("a", "bab", "cc"), ("aba", "bc", "c"), and ("ab", "abcc") are not. Unbalanced substrings are emphasized.
  
      Return the smallest number of substrings that s can be divided into.
  
      Note: A balanced string is a string where each character appears the same number of times.
  
      Examples:
      >>> s = "fabccddg"
      3
      >>> s = "abababaccddb"
      2
  
      Constraints:
      1 <= s.length <= 1000
      s contains only English lowercase letters.
      """
output:     
      from collections import Counter
  
      count = 0
      balance = Counter()
      
      for char in s:
          balance[char] += 1
          all_balanced = True
          values = list(balance.values())
          for value in values:
              if value != values[0]:
                  all_balanced = False
                  break
          if all_balanced:
              count += 1
              balance = Counter()
  
      return count
  