#include <bits/stdc++.h>
using namespace std;
string s;
string t = s;
int div() {
  int n = s.size();
  int ans = 1;
  string l = to_string(s.at(0));
  s = s.substr(1);
  while (s.size()) {
    if (to_string(s.at(0)) == l) {
      if (s.size() == 1) {
        if (t.at(n - 3) + t.at(n - 2) == l.at(0) + s.at(0)) {
          ans++;
          break;
        } else
          break;
      }
      l = to_string(s.at(0)) + to_string(s.at(1));
      s = s.substr(2);
      ans++;
    } else {
      l = to_string(s.at(0));
      s = s.substr(1);
      ans++;
    }
  }
  return ans;
}
int main() {
  cin >> s;
  cout << div() << endl;
}
