#include <iostream>
#include <string>
using namespace std;

int main() {
  int ans = 1;
    string s, s1, s2;
  	cin >> s;
  	s1 = s[0];
    for(int i = 1; i < s.size(); ++i) {
      s2 += s[i];
      if(s1 != s2) {
        ans++;
        s1 = s2;
        s2 = "";
      }
    }
    cout << ans << "\n";
}