#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test = 1;
  while (test--) {
    string str;
    cin >> str;
    string st = "";
    long long cnt = 1LL, n = (int)str.size();
    st += str[0];
    for (long long i = 1; i < n; ++i) {
      string tmp = "";
      tmp += str[i];
      while (st == tmp) {
        tmp += str[i];
        i++;
      }
      cnt++;
      st = tmp;
    }
    cout << cnt << "\n";
  }
}
