#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n;
char a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> a;
  n = strlen(a);
  int q = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] == a[i + 1]) ++q;
  }
  cout << (n - q + 1) << endl;
  return 0;
}
