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