#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
template <class T>
inline void chmax(T &a, const T &b) {
  if ((a) < (b)) (a) = (b);
}
template <class T>
inline void chmin(T &a, const T &b) {
  if ((a) > (b)) (a) = (b);
}
template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
long long solve() {
  string s;
  cin >> s;
  long long n = ((long long)(s).size());
  char now = s[0];
  long long ans = 1;
  for (long long i = (long long)(2); i < (long long)(n); ++i) {
    if (s[i - 1] == now) {
      i++;
      ans++;
      now = s[i + 1];
    } else {
      if (i == n - 1 && s[i - 1] == s[i]) {
      } else {
        ans++;
        now = s[i - 1];
      }
    }
    42;
  }
  cout << ans + 1 << endl;
  return 0;
}
signed main() {
  solve();
  return 0;
}
