#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.length();
  int str[len + 2];
  str[0] = 1;
  str[1] = 2;
  for (int i = 2; i < len; i++) {
    if (s[i - 1] != s[i])
      str[i] = str[i - 1] + 1;
    else
      str[i] = str[i - 1];
  }
  cout << str[len - 1] << endl;
  return 0;
}
