#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int countt = 0;
  vector<char> s1, s2;
  s1.push_back(s[0]);
  for (int i = 1; i < s.length(); i++) {
    s2.push_back(s[i]);
    if (s1 == s2) {
      s2.pop_back();
      s1.push_back(s[i]);
    } else {
      s1.empty();
      s1.push_back(s[i]);
      s2.empty();
      countt++;
    }
  }
  cout << countt - 1 << endl;
  return 0;
}
