#include <bits/stdc++.h>
using ll = long long;
using itn = int;
using namespace std;
using Graph = vector<vector<int>>;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int main() {
  string S;
  cin >> S;
  string r = S[0] + "";
  int cnt = 0;
  for (int i = 0; i < S.size(); i++) {
    string tmp = S[i] + "";
    int pp = 0;
    if (tmp == r) {
      for (int j = i; j < i + S.size(); j++) {
        tmp += S[j];
        pp++;
        if (tmp != r) {
          break;
        }
      }
    }
    r = tmp;
    cnt++;
    i += pp;
  }
  cout << cnt << endl;
}
