#include <bits/stdc++.h>
const double PI = acos(-1);
const int MAXX = 1000005;
const int maxInt = 2147483647;
using namespace std;
int vis[MAXX], dis[MAXX];
int main() {
  string s;
  long long int cnt = 0;
  int flag = 0;
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int a = s.length();
  if (a == 2 && s[0] == s[1]) {
    cout << 1 << '\n';
    return 0;
  }
  for (int i = 0; i < (s.length()); ++i) {
    if (flag == 1) {
      flag = 0;
      ++i;
    }
    if (s[i] == s[i + 1]) {
      ++cnt;
      flag = 1;
    } else
      ++cnt;
  }
  cout << cnt << '\n';
  return 0;
}
