#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  size_t size = s.length();
  int count = 1;
  int i = 2;
  while (i <= size) {
    if (s[i] == s[i - 1]) {
      i++;
    }
    i++;
    count++;
  }
  cout << count;
}
