#include <bits/stdc++.h>
using namespace std;
long long bigmod(string s) {
  long long n = s.size();
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans = ((ans * 10) + (s[i] - '0')) % 1000000007;
  }
  return ans;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  string s;
  cin >> s;
  int n = s.size();
  int c = 0;
  int count = 0;
  for (long long i = 0; i < n; i++) {
    if (i == n - 1) {
      if (s[i - 1] == s[i]) {
        i++;
        count++;
        if (c == 0) {
          count--;
        }
      } else {
        count++;
        c = 0;
      }
    } else if (i == 0) {
      count++;
      c = 0;
    } else {
      if (s[i - 1] == s[i]) {
        i++;
        count++;
        c = 1;
      } else {
        count++;
        c = 0;
      }
    }
  }
  cout << count << endl;
}
