#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int main() {
  string S;
  cin >> S;
  int idx = 1, ans = 1;
  string prev = S.substr(0, 1), cur = "";
  while (idx < S.length()) {
    int len = 1;
    while (prev == S.substr(idx, len)) len++;
    prev = S.substr(idx, len);
    idx += len;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
