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