#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  set<string> m;
  long long ans = 1;
  int i = 1;
  string t;
  t = s[0];
  while (i < s.length()) {
    string v;
    while (1) {
      v.push_back(s[i]);
      i++;
      if (i >= s.length() || t != v) break;
    }
    ans++;
    t = v;
  }
  cout << ans << endl;
  return 0;
}
