#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  string s;
  cin >> s;
  int n = s.size();
  if (n == 1) {
    cout << 1 << endl;
  } else if (n == 2) {
    if (s[0] == s[1]) {
      cout << 1 << endl;
    } else {
      cout << 2 << endl;
    }
  } else {
    int cnt = 0;
    int da = 0;
    for (int i = 0; i < n - 1; i++) {
      if (i >= n - 2) {
        if (i == n - 2) {
          if (s[n - 2] == s[n - 1]) {
            cnt++;
          } else {
            cnt += 2;
          }
        }
        break;
      }
      if (s[i] == s[i + 1]) {
        cnt += 2;
        i += 2;
      } else if (s[i] != s[i + 1]) {
        cnt++;
      }
    }
    cout << cnt << endl;
  }
}
