#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 + 2e5;
string s;
void solve() {
  cin >> s;
  string t;
  string t1;
  int ans = 0;
  t += s[0];
  for (int i = 0; i < s.size(); i++) {
    t1 += s[i];
    if (t1 != t) {
      ans++;
      t = t1;
      t1 = "";
    } else {
      t1 += s[i];
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  solve();
  return 0;
}
