#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5, MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string s;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  if (s.size() == 1)
    cout << 1 << endl;
  else {
    long long n = s.size(), cnt = 1, ans = 0;
    s += '?';
    for (long long i = 0; i < n; i++) {
      if (s[i] != s[i + 1]) {
        ans += (cnt + 1) / 2;
        cnt = 1;
      } else
        cnt++;
    }
    cout << ans;
  }
  return 0;
}
