#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  string temp;
  ll ans = 0;
  int prevlength = 0;
  int flag = 0;
  for (int i = 0; i < s.length() - 1; i++) {
    if (prevlength == 1) {
      if (s[i] != s[i + 1] && s[i] != s[i - 1]) {
        ans++;
        prevlength = 1;
      } else {
        ans++;
        i++;
        prevlength = 2;
      }
    } else if (prevlength == 2) {
      ans++;
      prevlength = 1;
    } else {
      if (s[i] != s[i + 1]) {
        ans++;
        prevlength = 1;
      } else {
        ans++;
        i++;
        prevlength = 2;
      }
    }
  }
  cout << ans + 1 << endl;
}
