#include <bits/stdc++.h>
using namespace std;
long long MOD = 10e9 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.size(), ans = n, len = 1;
  string save;
  int i = 0;
  while (i < n - 1) {
    if (save != s.substr(i, len)) {
      save = s.substr(i, len);
      len = 1;
      i += len;
    } else {
      len++;
      ans--;
    }
  }
  cout << ans << endl;
  return 0;
}
