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