#include <bits/stdc++.h>
using namespace std;
string s;
long long dp[200100] = {0};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin >> s;
  dp[1] = 1;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i + 1] != s[i]) chmax(dp[i + 1], dp[i] + 1);
    if (s[i + 1] == s[i]) chmax(dp[i + 1], dp[i]);
  }
  cout << dp[s.size()] << endl;
}
