#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
void Solve() {
  string s;
  cin >> s;
  long long n = s.size();
  long long i = n - 2;
  long long ans = 0;
  string lst = "";
  lst += s[n - 1];
  while (i >= 0) {
    string cur = "";
    cur += s[i];
    i--;
    while (i >= 0 && cur == lst) {
      cur += s[i];
      i--;
    }
    lst = cur;
    ans++;
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  Solve();
  return 0;
}
