#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vs = vector<string>;
const double pi = 3.14159265358979;
const ll mod = 1000000007;
int main() {
  string second;
  cin >> second;
  int N = second.size();
  int ans = 0;
  for (int i = 0; i < N - 1; i++) {
    if (second[i] == second[i + 1]) ans++;
  }
  cout << N - ans + 1 << endl;
}
