#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int res = 0;
  string str = "";
  string t = "";
  for (int i = 0; i < s.size(); i++) {
    if (t == str) {
      if (s.size() == i + 1) {
        break;
      }
      t += s[i];
      continue;
    } else {
      res++;
      str = t;
      t = "";
      t += s[i];
    }
  }
  if (t != str) {
    res++;
  }
  cout << res << endl;
  return 0;
}
