#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 mt(736);
void solve(istream &cin = std::cin, ostream &cout = std::cout) {
  string s;
  cin >> s;
  int ans = 0;
  string last = "";
  for (auto it : s) {
    if (last == string(1, it))
      last += it;
    else {
      last = it;
      ans++;
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  solve();
  return 0;
}
