#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
const long long INFLL = 1LL << 60;
const int INFI = 1000000000;
int main() {
  string S;
  cin >> S;
  int count = 0;
  for (int i = 0; i < S.size() - 1; i++) {
    if (S[i] == S[i + 1]) count++;
  }
  cout << S.size() - count + 1 << endl;
}
