#include <bits/stdc++.h>
using namespace std;
using Pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int main() {
  string S;
  cin >> S;
  long long N = S.size();
  long long ans = 1;
  long long idx = 1;
  string tmp = "";
  char ch = S[0];
  while (idx < N) {
    if (ch == S[idx]) {
      idx++;
      ans++;
      ch = S[idx];
      idx++;
    } else {
      ans++;
      ch = S[idx];
      idx++;
    }
  }
  long long ans2 = 1;
  idx = 2;
  ch = 'z' + 1;
  while (idx < N) {
    if (ch == S[idx]) {
      idx++;
      ans2++;
      ch = S[idx];
      idx++;
    } else {
      ans2++;
      ch = S[idx];
      idx++;
    }
  }
  cout << max(ans, ans2) << endl;
  return 0;
}
