#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;
int main() {
  string s;
  cin >> s;
  string t, p = "";
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    t += s[i];
    if (t == p) continue;
    p = t;
    t = "";
    ans++;
  }
  cout << ans << endl;
  return 0;
}
