#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long n = s.length();
  long long k = 1, c = 1, i = 1;
  while (i < n) {
    if (c == 1) {
      if (s[i] != s[i - 1]) {
        c = 1, k++, i++;
      } else {
        i += 2, c = 2, k++;
      }
    } else if (c == 2) {
      i++, c = 1, k++;
    }
  }
  if (s[n - 1] == s[n - 2])
    cout << k - 1;
  else
    cout << k;
  return 0;
}
