#include <bits/stdc++.h>
using namespace std;
template <typename Tn>
Tn __lcm(Tn a, Tn b) {
  return a / __gcd(a, b) * b;
}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  string s;
  cin >> s;
  long long int ans = s.size();
  for (int i = 0; i < s.size() - 1; i++)
    if (s[i] == s[i + 1]) ans--;
  cout << ans + 1 << endl;
  return 0;
}
