#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

int main() {
  
  string s;
  
  cin>>s;
  int ans = 0;
  
  string t, p = "";
  for(int i=0;i<s.size();i++){
    t += s[i];
    if (t == p) continue;
    p = t;
    t = "";
    ans++;
  }
  cout<<ans<<endl;
}