#include <bits/stdc++.h>
int main() {
  std::string word;
  std::cin >> word;
  int64_t count = 1;
  bool ok = false;
  for (int64_t i = 1; i < word.size(); i++) {
    if (word[i - 1] != word[i]) {
      count += 1;
    } else {
      count += 1;
      i += 1;
    }
  }
  std::cout << count;
}
