#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main(void) {
  string S;
  cin >> S;
  long long N = S.size(), Ans = 1;
  cerr << S[0] << endl;
  char pre = S[0];
  for (long long i = 0; i < (N - 1); ++i) {
    if (S[i] != S[i + 1]) {
      Ans++;
      pre = S[i + 1];
      cerr << S[i + 1] << endl;
      ;
    } else {
      Ans++;
      i++;
      cerr << S[i] << S[i + 1] << endl;
      pre = S[i + 1];
    }
  }
  cout << Ans << endl;
  return 0;
}
