#include <iostream>
#include <string>

using namespace std;

int main()
{
    int k;
    string s;
    cin >>s;
    k = s.length();
    for(int  i = 0; i < s.length() -1; i++)
    {
        if (s[i] == s[i+1]) {
            k--;
            i+=2;
        }
    }
    cout <<k;
}