#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  int ans1 = 0;
  int last = s[0];
  for (int i = 1; i < n; ++i) {
    if (s[i] == last) {
      ++i;
      last = -1;
      ++ans1;
      continue;
    }
    ++ans1;
    last = s[i];
  }
  int ans2 = 1;
  last = -1;
  for (int i = 2; i < n; ++i) {
    if (s[i] == last) {
      ++i;
      last = -1;
      ++ans2;
      continue;
    }
    ++ans2;
    last = s[i];
  }
  cout << max(ans1, ans2);
  return 0;
}
