#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;
template <typename T>
inline void chmin(T &a, T b) {
  if (a > b) a = b;
  return;
}
template <typename T>
inline void chmax(T &a, T b) {
  if (a < b) a = b;
  return;
}
const int INF = (1 << 30) - 1;
const int64 INF64 = (1LL << 62) - 1;
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  int ans = 1;
  int n = s.size();
  for (int i = 1; i < n; ++i) {
    if (s[i] == s[i - 1]) {
      ++i;
      ++ans;
    } else {
      ++ans;
    }
  }
  cout << ans << '\n';
  return 0;
}
