#include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin>>s;
    int countt=0;
    vector <string> s1,s2;
    s1.push_back(s[0]);
    for(int i=1;i<s.length();i++){
    	s2.push_back(s[i]);
    	if(s1==s2){
    		s2.pop_back(s[i]);
    		s1.push_back(s[i]);
    	}
    	else{
    		s1.empty();
    		s1.push_back(s[i]);
    		s2.empty();
    		countt++;
    	}
    }
    cout<<countt<<endl;
	

	return 0;
}