#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long n) {
  if (n == 0)
    return 1;
  else if (n % 2)
    return b * power(b, n / 2) * power(b, n / 2);
  else
    return power(b, n / 2) * power(b, n / 2);
}
long double root(long long n, long long r) {
  long double dif = 0.0001;
  long double guess = n / 2.0;
  while (abs(pow(guess, r) - n) >= dif) {
    long double temp = pow(guess, r) - n;
    long double tmp = r * pow(guess, r - 1);
    guess -= temp / tmp;
  }
  return guess;
}
void fileio() {}
int solve() {
  string x;
  cin >> x;
  x += x[x.size() - 1];
  queue<string> q;
  int i = 0;
  while (i < (int)x.size()) {
    string c = "";
    c += x[i];
    if (x[i] == x[i + 1]) {
      i++;
      c += x[i + 1];
    }
    q.push(c);
    i++;
  }
  int n = 0;
  while (!q.empty()) {
    q.pop();
    n++;
  }
  cout << n;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << fixed << setprecision(6);
  solve();
  return 0;
}
