#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  string s;
  cin >> s;
  string a = s[0] + "";
  string b = "";
  int ans = 1;
  for (ll i = ll(1); i < ll(s.length() - 1); i++) {
    b = s[i];
    while (b == a) {
      i++;
      b += s[i];
    }
    a = b;
    ans++;
  }
  cout << ans;
}
