#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
using ll = long long;
using prique = priority_queue<long long>;
signed main() {
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
  string s;
  cin >> s;
  long long ans = 0;
  string b = "";
  bool fin = false;
  for (long long i = 0; i < s.size(); i += 0) {
    long long c = 1;
    while (1) {
      if (s.substr(i, c) != b) {
        b = s.substr(i, c);
        i += c;
        c = 1;
        ans++;
        break;
      } else {
        c++;
        if (i + c >= s.size()) {
          fin = true;
          break;
        }
      }
    }
    if (fin) break;
  }
  cout << ans << endl;
  return 0;
}
