#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<int, pii>;
const int inf = 1e9 + 7;
const int base = 311;
string s;
ll Hash = 0, res = 0, Hash1 = -1;
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    Hash = (Hash * base + s[i] - 'a' + 1) % inf;
    if (Hash != Hash1) {
      res++;
      Hash1 = Hash;
      Hash = 0;
    }
  }
  cout << res;
  return 0;
}
