using System;
using System.Collections.Generic;
using System.Linq;
class Hjo {
  static void Main(){
    string aho = Console.ReadLine();
    var retu = new List<char>();
    var S  = aho.Length;
     for (int i = 0; i < aho.Length; i++)
     {
       retu.Add(aho[i]);
     }
       for(var i = 0;i<retu.Count-1;){
          if(retu[i] == retu[i+1]){
           i +=1;
          }
          else{
            retu.RemoveAt(i);
            retu.RemoveAt(i);
            Console.WriteLine(retu.Count);
            i= 0;
          }
       }
         Console.WriteLine(S-retu.Count);
        
  }
}