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