#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s;
  int ans = 1;
  cin >> s;
  for (int i = 1; i < s.size(); i++) {
    ans++;
    if (s[i] == s[i - 1]) i++;
  }
  cout << ans << endl;
  return 0;
}
