#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i = 1, cnt = 1;
  string str, s1, s2;
  cin >> str;
  s1 = to_string(str[0]);
  while (i < str.size()) {
    s2 = to_string(str[i]);
    if (s1 == s2) {
      i++;
      s2.push_back(str[i]);
    }
    cnt++;
    s1 = s2;
    i++;
  }
  cout << cnt;
  return 0;
}
