#include <bits/stdc++.h>
using namespace std;
string S;
vector<int> X;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  cin >> S;
  int curr = 1;
  for (int i = 1; i < S.size(); i++) {
    if (S[i] == S[i - 1])
      curr++;
    else {
      X.push_back(curr);
      curr = 1;
    }
  }
  X.push_back(curr);
  int ans = 0, flag = 0;
  for (int i = 0; i < X.size(); i++) {
    if (X[i] % 2)
      ans += (X[i] + 1) / 2, flag = 0;
    else {
      if (flag)
        ans += X[i] / 2 + 1, flag = 0;
      else
        ans += X[i] / 2, flag = 1;
    }
  }
  cout << ans << "\n";
  return 0;
}
