#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int sol = 0;
  for (int i = 1; i < s.size(); ++i) {
    sol++;
    if (s[i] == s[i - 1]) i++;
  }
  cout << sol + 1;
}
