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