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

class AtCoder
{
    const int MOD = 1000000007;
    public void Slove()
    {
        var str = Console.ReadLine();
        char bef = str.First();
        bool twoChar = false;
        int ans = 1;
        foreach(char c in str.Skip(1))
        {
            if(c == bef && !twoChar)
            {
                twoChar = true;
            }
            else
            {
                ans++;
                twoChar = false;
            }
            bef = c;
        }
        Console.WriteLine(ans);
    }
    static void Main()
    {
        var ac = new AtCoder();
        ac.Slove();
    }
}