#include <bits/stdc++.h>
using namespace std;
int test[101];
int main() {
  long long n, a = 0, ans = 0;
  char b = 'a';
  string s;
  cin >> s;
  for (int h = 0; h < s.size() - 1; h++) {
    if (h == 0) {
      ans++;
      b = s[0];
    } else if (a != 0) {
      a = 0;
      ans++;
      b = s[h];
    } else if (b == s[h]) {
      a = 1;
      ans++;
      h++;
    } else {
      ans++;
      b = s[h];
    }
  }
  if (s[s.size() - 2] != s[s.size() - 1]) {
    ans++;
  }
  cout << ans << endl;
  cin >> n;
}
