#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int memo = 0;
  for (int i = 1; i < (int)(n); i++) {
    if (s[i] == s[i - 1]) memo++;
  }
  cout << n - memo + 1 << endl;
}
