#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int len;
  string s, t;
  cin >> s;
  len = (int)s.length();
  int cnt = 0;
  for (int i = len - 1; i > 0; i--) {
    if (s[i - 1] == s[i]) {
      if (i == 1) {
        cnt++;
        break;
      }
      i -= 2;
      cnt += 2;
    } else {
      cnt++;
    }
  }
  cout << cnt;
}
