#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T n, T m) {
  return m ? gcd(m, n % m) : n;
}
long long const N = 200000;
char memory;
long long ans = 0;
int c = 0;
void dp(string s, int i, int c) {
  if (i == s.size())
    return;
  else {
    if (i == 0) {
      memory = s[i];
      ans++;
    } else {
      if (s[i] != memory) {
        memory = s[i];
        ans++;
      }
      if (s[i] == memory) {
        if (c == 0)
          c++;
        else
          ans++;
        c = 0;
      }
    }
  }
  i++;
  dp(s, i, c);
}
int main() {
  string s;
  cin >> s;
  dp(s, 0, c);
  cout << ans + 1 << endl;
}
