#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int ans = 1;
  for (int i = 0; i < S.length() - 1; i++) {
    ans++;
    if (S[i] == S[i + 1]) i++;
  }
  cout << ans << endl;
}
