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