import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
//auto PS = new Tuple!(long,string)[](M);
//x[]=1;でlong[]全要素1に初期化
void main()
{
    auto s = sread();
    long i = 1;
    string previous; //前の文字
    previous = s[0 .. 1];
    // writeln(previous);
    long cnt = 1;
    // writeln(s);
    while (i < (s.length))
    {
        // writeln(s[i .. i + 1]);
        if (previous == s[i .. i + 1])
        {
            if (i + 2 <= s.length)
            {
                previous = s[i .. i + 2];
                i += 2;
                cnt += 1;
            }
            else
            {
                break;
            }
        }
        else
        {
            if (i + 1 <= s.length)
            {
                previous = s[i .. i + 1];
                i += 1;
                cnt += 1;
            }
            else
            {
                break;
            }
        }
        // writeln("i:", i);
        // writeln("pre:", previous);
    }
    writeln(cnt);
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}
