#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
const long long mod = (int)1e9 + 7;
int main() {
  string S;
  cin >> S;
  int sum = 2;
  int cut = 0;
  for (int i = 0; i < S.length(); i++) {
    if (i != 0) {
      if (S[i] == S[i - 1] && cut == 0) {
        continue;
        cut = 1;
      } else {
        cut = 0;
        sum++;
        cerr << i;
      }
    }
  }
  cout << sum;
}
