#include <bits/stdc++.h>
constexpr int l = 10000;
int main() {
  char a;
  char buf[l];
  for (int j = 0; j < l; j++) {
    buf[l] = -1;
  }
  int k = 1;
  std::cin >> buf[0];
  bool flag = false;
  while (!flag) {
    for (int p = 0; 1; p++) {
      if (!(std::cin >> a)) {
        flag = true;
        break;
      }
      if (buf[p] != a) {
        buf[p] = a;
        k++;
        break;
      }
    }
  }
  std::cout << k;
}
