#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  string back = "";
  back += s[0];
  string front = "";
  ll ans = 1;
  for (int i = 1; i < s.size(); ++i) {
    front += s[i];
    if (front != back) {
      ans++;
      back = front;
      front = "";
    } else
      back += s[i];
  }
  cout << ans << endl;
}
