#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
int main() {
  string S;
  cin >> S;
  int ans = 1;
  for (int i = (int)(0); i < (int)(S.size() - 1); i++) {
    if (S[i + 1] == S[i]) {
      i++;
      ans++;
    } else {
      ans++;
    }
  }
  cout << ans << endl;
}
