#include <bits/stdc++.h>
using namespace std;
int len;
string s;
int sum = 0;
void dfs(int i, string sx) {
  if (i >= len) return;
  if (i == len - 1) {
    if (s[len - 1] == s[len - 2] && s[len - 2] == s[len - 3] &&
        s[len - 3] == s[len - 4]) {
      sum--;
      return;
    }
    if (s[len - 1] == s[len - 2]) {
      return;
    }
  }
  string s1;
  int p = 1;
  s1 = s.substr(i, p);
  while (sx == s1) {
    p++;
    s1 = s.substr(i, p);
  }
  sum++;
  dfs(i + p, s1);
}
int main() {
  cin >> s;
  len = s.length();
  dfs(0, s);
  cout << sum;
}
