#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans=0;
  string s1="",s2="";
  for(int i=0; i<s.size(); i++) {
    s1+=s[i];
    if(s1!=s2) {
      s2=s1;
      ans++;
      s1="";
    }
  }
  cout << ans << endl;
}