#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;
int main() {
  string s;
  cin >> s;
  ll res = 0;
  char x = '-';
  for (char c : s) {
    if (c != x) {
      res++;
    }
    x = c;
  }
  cout << res + 1 << endl;
  ;
}
