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