#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  int n = s.size();
  char c = s[0];
  for (int i = 1; i < n; i++) {
    if (s[i] == c) {
      i++;
      c = 'A';
    } else
      c = s[i];
    ans++;
  }
  cout << ans << endl;
}
