#include <bits/stdc++.h>
using namespace std;
typedef struct _data {
  int x;
  int y;
} data;
int main() {
  string s;
  cin >> s;
  vector<string> d;
  int i = 0;
  while (i < s.size()) {
    if (s[i] == s[i + 1]) {
      if (d.empty() && s[i + 1] != '\0') {
        d.push_back(s.substr(i, 1));
      }
      if (s.substr(i, 1) != d[d.size() - 1]) {
        d.push_back(s.substr(i, 1));
      } else if (s[i + 1] != '\0') {
        d.push_back(s.substr(i, 2));
        i++;
      }
    } else if (s[i] != s[i + 1]) {
      if (d.empty()) {
        d.push_back(s.substr(i, 1));
      } else if (s.substr(i, 1) != d[d.size() - 1]) {
        d.push_back(s.substr(i, 1));
      } else if (s[i + 1] != '\0') {
        d.push_back(s.substr(i, 2));
        i++;
      }
    }
    i++;
  }
  cout << d.size();
  return (0);
}
