input: Write a python function that takes a list of integers representing a sequence of red and blue tiles arranged in a circle. In the list, 0 represents a red tile and 1 represents a blue tile. The function should return the count of groups where every three consecutive tiles alternate in color (i.e., the middle tile differs in color from the tiles on either side).
  
  from typing import List
  
  def count_alternating_triplets(colors: List[int]) -> int:
      """
      You have a circular arrangement of tiles that are either red or blue. This setup is described by an array where each integer represents a tile's color:
  
      colors[i] == 0 indicates a red tile.
      colors[i] == 1 indicates a blue tile.
      A triplet of tiles is considered an alternating group if each set of three consecutive tiles alternates in color, meaning the middle tile is different from its adjacent tiles.
  
      Calculate and return the number of such alternating triplets.
  
      Note:
      Due to the circular nature of the array, the first and last tiles are adjacent.
  
      Examples:
      >>> colors = [1,1,1]
      0
      >>> colors = [0,1,0,0,1]
      3
  
      Constraints:
      3 <= len(colors) <= 100
      0 <= colors[i] <= 1
      """
output: def count_alternating_triplets(colors: List[int]) -> int:
      n = len(colors)
      count = 0
      for i in range(n):
          if colors[i] != colors[(i + 1) % n] and colors[(i + 1) % n] != colors[(i + 2) % n]:
              count += 1
      return count