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