#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1000000007;
signed main() {
  string s;
  cin >> s;
  long long ans = 1;
  long long i = 1;
  while (i < s.length()) {
    if (s[i - 1] != s[i]) {
      ans++;
      i++;
    } else {
      if (i != s.length() - 1 && (s[i + 1] != s[i])) {
        ans += 2;
        i += 3;
      } else {
        ans++;
        i += 2;
      }
    }
  }
  cout << ans;
  return 0;
}
