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