#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int add(int x, int y) {
  x += y;
  if (x >= mod) return x - mod;
  return x;
}
int sub(int x, int y) {
  x -= y;
  if (x < 0) return x + mod;
  return x;
}
int mul(int x, int y) { return (long long)x * y % mod; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int sol = 0;
  string s;
  cin >> s;
  int n = s.size();
  char last = '$';
  for (int i = 0; i < n; ++i) {
    char c = s[i];
    if (c == last) {
      sol++;
      last = '$';
    } else {
      last = c;
      sol++;
    }
  }
  cout << sol << endl;
}
