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