#include <bits/stdc++.h>
using namespace std;
string s;
int ct;
bool ok = 0;
int main() {
  cin >> s;
  ct = 1;
  for (int i = 1; i < s.length(); i++) {
    if (ok == 0 && s[i - 1] != s[i])
      ct++;
    else if (ok == 0 && s[i - 1] == s[i]) {
      ct++;
      i++;
      if (i == s.length()) ct--;
    } else if (ok == 1)
      ct++;
  }
  cout << ct;
}
