#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1};
int dy[] = {1, 0, 0, -1, 1, -1, -1, 1};
int main() {
  string s;
  cin >> s;
  int ans = 0;
  int len = 1;
  string tmp = "";
  for (int i = 0; i < (int)s.size();) {
    string str = s.substr(i, len);
    if (tmp != str) {
      ans++;
      tmp = str;
      i += len;
    } else {
      len++;
      if (len + i >= (int)s.size()) break;
      continue;
    }
    len = 1;
  }
  cout << ans << endl;
}
