#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using ll = long long;
const int INF = 2147483647;
using namespace std;
int ggd(int number1, int number2) {
  int m = number1;
  int n = number2;
  if (number2 > number1) {
    m = number2;
    n = number1;
  }
  while (m != n) {
    int temp = n;
    n = m - n;
    m = temp;
  }
  return m;
}
int lcm(int number1, int number2) {
  return number1 * number2 / ggd(number1, number2);
}
bool is_prime(int64_t x) {
  for (int64_t i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  char str[200010], befs, curs;
  int ans = 0;
  bool bef = false;
  scanf("%s", str);
  string s = str;
  befs = curs = str[0];
  for (int i = 1; i < s.length(); ++i) {
    befs = str[i - 1];
    curs = str[i];
    if (bef && befs == curs) {
      --ans;
    }
    bef = false;
    if (befs == curs) {
      ++ans;
      bef = true;
    }
  }
  printf("%d\n", int(s.length() - ans));
  return 0;
}
