input: from typing import List
  
  def count_alternating_triplets(colors: List[int]) -> int:
      """
      You have a circular arrangement of tiles that are red and blue. You are given an array of integers colors. The color of tile i is represented by colors[i]:
  
      colors[i] == 0 means the tile is red.
      colors[i] == 1 means the tile is blue.
      Any sequence of 3 consecutive tiles in the circle where the colors alternate (i.e., the central tile has a different color from both its adjacent tiles) is called an alternating triplet.
  
      Return the total number of such alternating triplets.
  
      Note:
       since the array is circular, the first and the last tiles are considered adjacent.
  
      Examples:
      >>> colors = [1,1,1]
      0
      >>> colors = [0,1,0,0,1]
      3
  
      Constraints:
      3 <= len(colors) <= 100
      0 <= colors[i] <= 1
      """
output:     
      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] and colors[i] != colors[(i + 2) % n]:
              count += 1
              
      return count
  