#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
const long double pi = acos(-1);
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
inline void init() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
template <class T>
inline istream& operator>>(istream& input, vector<T>& v) {
  for (auto& elemnt : v) input >> elemnt;
  return input;
}
int main() {
  init();
  string s;
  cin >> s;
  int n = s.length();
  int ans = 0;
  char bef = 'x';
  for (int(i) = (0); (i) < (n); ++(i)) {
    if (s[i] == bef) {
      if (i == n - 1) break;
      ++i;
      bef = 'x';
    } else
      bef = s[i];
    ++ans;
  }
  cout << ans << "\n";
}
