#include <bits/stdc++.h>
using namespace std;
string s;
void solve() {
  cin >> s;
  long long n = int(s.size());
  long long len = 1;
  long long ans = 1;
  for (int i = 1; i < n - 1; i++) {
    if (s[i] == s[i - 1]) {
      if (len == 1) {
        len = 2;
        ans++;
        i++;
      } else {
        len = 1;
        ans++;
      }
    } else {
      len = 1;
      ans++;
    }
  }
  if (s[n - 1] == s[n - 2]) {
    if (len == 2) ans++;
  } else
    ans++;
  cout << ans << endl;
}
int main(int argc, char *argv[]) {
  solve();
  return 0;
}
