#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, cur;
  cin >> s;
  int cnt = 1, i = 1;
  int n = s.size();
  cur = s[i];
  while (i < n) {
    string s1 = "";
    s1 += s[i];
    i++;
    while (i < n && s1 == cur) {
      s1 += s[i];
      i++;
    }
    cnt++;
    if (i == n && s1 == cur) cnt--;
    cur = s1;
  }
  cout << cnt;
  return 0;
}
