#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
long long gcd(long long A, long long B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
long long lcm(long long A, long long B) { return A * B / gcd(A, B); }
int main() {
  string s;
  cin >> s;
  int n = s.size();
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int count = 0;
  bool skip = false;
  for (long long int i = 1; i < n; i++) {
    if (skip) {
      count++;
      skip = false;
    } else {
      if (s[i - 1] == s[i]) {
        i++;
        count++;
        skip = true;
      } else {
        count++;
        skip = false;
      }
    }
  }
  if (n == 2) {
    if (s[0] == s[1])
      cout << 1 << endl;
    else
      cout << 2 << endl;
  } else {
    cout << count << endl;
  }
}
