#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
const int MOD = 1000000007;
int main() {
  string s, temp, st;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size() - 1; ++i) {
    st = s[i];
    if (st == temp) {
      temp.push_back(s[i]);
      continue;
    }
    ans++;
    temp = s[i];
  }
  cout << ans + 1;
  return 0;
}
