#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class Value>
using vec = vector<Value>;
using ll = long long;
using P = pair<long long, long long>;
void Main();
int main() {
  std::cin.tie(nullptr);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}
void Main() {
  string S;
  cin >> S;
  string bt = S[0] + "", t = "";
  int cnt = 0;
  for (int i = (1), i_len = (S.length()); i < i_len; ++i) {
    t += S[i];
    if (bt != t) {
      bt = t;
      t = "";
      cnt++;
    }
  }
  cout << cnt << endl;
}
