#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  string m;
  string tmp;
  tmp.push_back(s[0]);
  int count = 0;
  tmp.clear();
  int i;
  for (i = 1; i < s.size(); ++i) {
    while (i < s.size()) {
      tmp.push_back(s[i]);
      if (m != tmp) {
        m = tmp;
        break;
      }
      ++i;
    }
    ++count;
    tmp.clear();
  }
  cout << count << endl;
  return 0;
}
