#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt = 1;
  for (int i = 0; i < s.size() - 1; i++) {
    if (i == 0 || s[i] != s[i + 1])
      cnt++;
    else
      s[i + 1] = 'A';
  }
  cout << cnt << endl;
}
