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