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