#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;

    string preS = "A";
    string nowS;
    nowS = "";
    long count = 0;
    char alphabet = "";
    char prealpha = "";
    long alphabet_count = 0;
    for(int i = 0; i < S.size(); i++)
    {
        alphabet = S[i];
        nowS += alphabet;
//        cout <<  "now:" << nowS << endl;
        if(preS != nowS)
        {
//            cout <<  "pre:" << preS << "now:" << nowS << endl;
            preS = nowS;
            nowS = "";
            count++;
        }

    cout << count << endl;
    return 0;  

}