#include <bits/stdc++.h>
using ll = long long;
const ll mod = 1000000007;
const ll infi = 1000000000000000;
const ll md = 998244353;
using namespace std;
using vl = vector<ll>;
using pll = pair<ll, ll>;
int main() {
  string s;
  cin >> s;
  if (s.size() == 1) {
    cout << 1;
    return 0;
  }
  ll tot = 0, sum = 0;
  vector<int> a;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1]) {
      tot++;
      i++;
    }
  }
  cout << s.size() - tot;
  return 0;
}
