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