using System;

    class Program
    {
        static void Main(string[] args)
        {
            string s;
            s = Console.ReadLine();

            int index = 0;
            int k = 0;
            string sub = string.Empty;
            while (index < s.Length)
            {
                if (sub.Equals(s.Substring(index, 1)))
                {
                    if (index + 2 < s.Length)
                    {
                        sub = s.Substring(index, 2);
                        index += 2;
                        k++;
                    }
                    else
                    {
                        index += 1;
                    }
                }
                else
                {
                    sub = s.Substring(index, 1);
                    index += 1;
                    k++;
                }
            }

            Console.WriteLine(k);
        }
    }
