#include <bits/stdc++.h>
using namespace std;
int main() {
  string str1, str2, S;
  int Ssize;
  cin >> S;
  Ssize = S.size();
  int count = 1;
  int ans = 1;
  str1 = S.at(0);
  str2 = S.at(1);
  while (count < Ssize) {
    if (str1 != str2) {
      str1 = str2;
      str2.clear();
      ans++;
    }
    str2 = str2 + S.substr(count, 1);
    count++;
  }
  cout << ans << endl;
}
