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