#include <bits/stdc++.h>
using namespace std;
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>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
bool compare_by_b(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second != b.second)
    return a.second < b.second;
  else
    return a.first < b.first;
}
std::uint32_t euclidean_gcd(std::uint32_t a, std::uint32_t b) {
  return b != 0 ? euclidean_gcd(b, a % b) : a;
}
void solve(std::string s) {
  char prev = s[0];
  int idx = 1;
  int ans = 1;
  while (idx < s.size()) {
    if (s[idx] == prev) {
      if (idx == s.size() - 1) {
        cout << ans << endl;
        return;
      }
      ans += 2;
      idx += 2;
      prev = s[idx];
      idx++;
    } else {
      prev = s[idx];
      idx++;
      ans++;
    }
  }
  cout << ans << endl;
}
int main() {
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}
