using System;
class pg
{
  static void Main(string[] args)
  {
    string a = Console.ReadLine();
    int count = 0;
    string ppreStr = string.Empty;
    string preStr = string.Empty;
    string nowStr = string.Empty;
    foreach(char i in a)
    {
      nowStr = nowStr + i;
      if(preStr == nowStr)
      {
      }
      else
      {
        ppreStr = preStr;
        preStr = nowStr;
        nowStr = string.Empty;
        count++;
      }
    }
    
    if(!String.IsNullOrEmpty(nowStr))
    {
      if(ppreStr == preStr+nowStr)
      {
        count--;
      }
    }
    
    Console.WriteLine(count);
  }
}
