#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  char a = s[0];
  for (int i = 0; i < s.size(); ++i) {
    if (i == s.size() - 1 || i == 0) {
      a = s[i];
      ++cnt;
      continue;
    }
    if (a == s[i - 1]) {
      a = '1';
    } else {
      a = s[i + 1];
      ++cnt;
    }
  }
  cout << cnt << "\n";
  return 0;
}
