#include <bits/stdc++.h>
using namespace std;
long long ans, mx, sum, mn = 1e8, cnt;
int main() {
  string s;
  cin >> s;
  if (s[0] == s[1]) ans++;
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] != s[i + 1] && i < s.size() - 1)
      ans++;
    else {
      i++;
      ans++;
    }
  }
  cout << ans << endl;
}
