#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s, s1, s2;
  cin >> s;
  long long int count = 1, i;
  s1 = s[0];
  for (i = 1; i < s.size(); i++) {
    s2 = s2 + s[i];
    if (s1 != s2) {
      count++;
      s1 = s2;
      s2 = "";
    }
  }
  cout << count;
}
