#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int n = s.size();
  int cnt = 1;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i + 1) == s.at(i)) i += 1;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
