using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var count = 0;
            var cur = "";

            for (var i = 0; i < s.Length; i++)
            {
                if (cur != s[i].ToString())
                {
                    cur = s[i].ToString();
                    count++;
                }
                else
                {
                    cur = s[i].ToString();
                    if (i < s.Length - 2)
                    {
                        cur += s[i + 1].ToString();
                        count++;
                        i++;
                    }
                }
            }

            Console.WriteLine(count);
        }
    }
}
