using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

class Program
{
    static void Main(string[] args)
    {
      //入力を受け取る
      var S = Console.ReadLine();
      var count = 0;
      
      for(int i = 1 ; i < S.Length ; i++){
        if(S[i] == S[i-1]){
          count += 2;
          i++;
        }
      }
      Console.WriteLine(count);
    }
}


