#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s2 = "", s3 = "";
  cin >> s;
  vector<string> s1;
  s2 += s[0];
  s1.push_back(s2);
  for (int i = 1; i < s.length(); i++) {
    s3 = "";
    s2 = s[i - 1];
    s3 += s[i];
    while (s3 == s2 && i < s.length()) {
      i = i + 1;
      s3 += s[i];
    }
    s1.push_back(s3);
  }
  cout << s1.size() << endl;
}
