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