#include <iostream>
using namespace std;
int ans; string S,cur,lst;
int main() {
    cin.sync_with_stdio(0); cin.tie(0); cin>>S; cur = lst = "";
    for (int i = 0;i < S.size();i++) {cur += S[i]; if (cur != lst) ans++,lst = cur,cur = "";}
    cout<<ans<<"\n";
}
