#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long ans = 0;
  int a = 0;
  for (int i = 0; i < s.size(); i++) {
    if (i == 0) {
      ans++;
      continue;
    }
    if (a == 1)
      ans++, a = 0;
    else {
      if (s[i - 1] == s[i])
        a = 1;
      else
        ans++, a = 0;
    }
  }
  cout << ans;
}
