#include <bits/stdc++.h>
using namespace std;
string s, eh, ss[202020];
int ans = 1;
int main() {
  cin >> s;
  eh += s[0];
  for (int i = 1; i < s.size(); i++) {
    if (eh != ss[ans - 1]) {
      ss[ans] = eh;
      ans++;
      eh += s[i];
    } else {
      eh += s[i];
    }
  }
  cout << ans - 3 << endl;
  return 0;
}
