#include <bits/stdc++.h>
using namespace std;
string s;
int ans1, ans2;
bool length2;
int main() {
  cin >> s;
  for (register int i = 0; i < s.length() - 1; i++) {
    ans1++;
    if (length2)
      length2 = false;
    else {
      if (s[i] == s[i + 1]) {
        length2 = true;
        ++i;
      }
    }
  }
  length2 = true;
  for (register int i = 0; i < s.length() - 1; i++) {
    ans2++;
    if (length2)
      length2 = false;
    else {
      if (s[i] == s[i + 1]) {
        length2 = true;
        ++i;
      }
    }
  }
  cout << (ans1 > ans2 ? ans1 : ans2);
}
