#include <bits/stdc++.h>
using namespace std;
constexpr int long long bigNum = 1000000007;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string str;
  cin >> str;
  string pre = "0";
  int l = 0;
  int fetch = 1;
  int leng = str.size() - 1;
  string tmp;
  int count = 0;
  while (l <= leng) {
    tmp = str.substr(l, fetch);
    if (pre != tmp) {
      count++;
      pre = tmp;
      l += fetch;
      fetch = 1;
    } else if (l == leng) {
      break;
    } else {
      fetch++;
    }
  }
  cout << count;
}
