using System;
class Program
{
	static void Main()
	{
	string input = Console.ReadLine();
	int answer = 1;
    
    for(int i = 0; i < input.Length; i++)
    {
      if(input[i] == input[i + 1])
               {
                 answer ++;
               }
      
    }
      
	Console.WriteLine(answer);
	}
}