#include <bits/stdc++.h>
using namespace std;
void file() {}
const long long nax = 2e5 + 1, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  int cnt = 1;
  for (long long i = 0; i < n; i++) {
    int j = i;
    while (j < n && s[j] == s[i]) {
      j++;
    }
    i = j - 1;
    cnt++;
  }
  cout << cnt;
  return 0;
}
