#include <bits/stdc++.h>
int ri() {
  int n;
  scanf("%d", &n);
  return n;
}
int64_t rll() {
  long long n;
  scanf("%lld", &n);
  return n;
}
int main() {
  std::string s;
  std::cin >> s;
  std::string last = "";
  int n = s.size();
  int head = 0;
  int res = 0;
  while (head < n) {
    std::string cur{s[head]};
    head++;
    if (last == cur) cur.push_back(s[head++]);
    last = cur;
    res++;
  }
  std::cout << res << std::endl;
  return 0;
}
