#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 1;
  string sub(1, s[0]);
  for (int i = 1; i < n; i++) {
    string str1(1, s[i]);
    string str2(1, s[i + 1]);
    if (sub != str1 && str1 != str2) {
      sub = str1;
    } else {
      sub = str1 + str2;
      i++;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
