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

const int MAX = 1000000007;
 
 



signed main(){
    string s;
    cin>>s;
    int ans=1;
    int i=1;
    while(i<s.length()){
        if(s[i-1]!=s[i]){
            ans++;
            i++;
        }else{
            ans++;
            i+=2;
        }
    }
    cout<<ans;
    
    
    return 0;
}