#include <iostream>
using namespace std;
int main()
{
    int ans = 0;
    string s, bef, aft;
    cin >> s;
    for(size_t i = 0; i < s.size(); i++){
        aft += s[i];
        if(bef != aft){
            ans++;
            bef = aft;
            aft = "";
        }
    }
    cout << ans << endl;
    return 0;
}