#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T itr1, T itr2) {
  auto now = itr1;
  while (now < itr2) {
    cout << *now << " ";
    now++;
  }
  cout << endl;
}
const long long MOD = pow(10, 9) + 7;
const long long LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main() {
  string S;
  cin >> S;
  int l = S.length();
  int result = 0, pos = 0, last = 0;
  while (pos < l) {
    if (pos == 0) {
      pos++;
      last = 1;
      result++;
    } else if (S[pos] != S[pos - 1]) {
      pos++;
      last = 1;
      result++;
    } else if (S[pos] == S[pos - 1]) {
      pos++;
      last = 2;
    }
  }
  result++;
  cout << result << endl;
  return 0;
}
