#include <bits/stdc++.h>
int main() {
  std::string s;
  std::cin >> s;
  int count = 0;
  for (int i = 0; i < s.size() - 1; ++i) {
    ++count;
    if (s[i] == s[i + 1]) {
      ++i;
    }
  }
  std::cout << count << std::endl;
  return 0;
}
