#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  string s;
  cin >> s;
  int ans = s.size();
  for (long long i = 1; i < (long long)(s.size()); i++)
    if (s[i] == s[i - 1]) --ans;
  cout << ++ans << endl;
  return 0;
}
