#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
T digitsum(T n);
template <typename T>
T gcd(T u, T v);
template <typename T>
bool isPrime(T n);
template <typename T>
vector<pair<T, T>> prime_factor(T n);
long long int intpow(long long int, long long int);
template <typename T>
T intlog(T);
int main() {
  string s;
  cin >> s;
  int ans = s.length();
  for (int i = 0; i < (int)(s.length() - 1); i++) {
    if (s[i] == s[i + 1]) {
      ans--;
      i++;
      if (i >= s.length() - 1) ans++;
    }
  }
  cout << ans << endl;
}
