#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int i = 0, count = 0, store;
  string s;
  cin >> s;
  if (s.size() == 1) {
    cout << "0";
    exit(0);
  } else if (s.size() == 2) {
    if (s[0] == s[1]) {
      cout << "0";
    } else {
      cout << "1";
    }
    exit(0);
  }
  while (i < (long long int)s.size() - 1) {
    if (s[i] == s[i + 1]) {
      count++;
      i = i + 2;
    } else {
      count++;
      i++;
    }
  }
  cout << count + 1;
  return 0;
}
