#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
void solve(std::string S) {
  long long cnt = 0;
  for (long long i = 0; i < S.length(); i++) {
    if (S[i] == S[i + 1]) {
      cnt++;
    }
  }
  cout << S.length() - cnt + 1 << endl;
}
int main() {
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}
