#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  int ans = 0;
  string S;
  cin >> S;
  char C;
  for (int i = 0; i < S.size(); ++i) {
    if (S[i] == C) {
      ++i;
    }
    C = S[i];
    ans++;
  }
  cout << ans << '\n';
  return 0;
}
