#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 1, k = 0, ans = 0;
  string s;
  cin >> s;
  while (k < s.length() - 1) {
    if (n == 2) {
      if (s[k] == s[k + 1]) {
        n = 2;
        ans++;
        k = k + 2;
      } else {
        k++;
        ans++;
        n = 1;
      }
    } else if (n == 1) {
      if (s[k] != s[k + 1]) {
        n = 1;
        ans++;
        k++;
      } else {
        n = 2;
        ans++;
        k = k + 2;
      }
    }
  }
  if ((s.length() == 2) && s[0] == s[1]) ans = 0;
  cout << ans + 1 << endl;
  return 0;
}
