#include <bits/stdc++.h>
using namespace std;
const int max_n = 2011, max_m = 500011, inf = 1000111222;
const long long inff = 1000111222333444;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i + 1 < s.length(); ++i) {
    cnt += s[i] == s[i + 1];
  }
  cout << s.length() - cnt + 1 << endl;
  return 0;
}
