#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  string s;
  cin >> s;
  int count = 0;
  string prev = "";
  for (int i = 0; i < s.length();) {
    string present = {s[i]};
    i++;
    if (prev.length() != 2 && present == prev && i < s.length()) {
      present = s.substr(i, 2);
      i++;
    }
    if (present == prev) break;
    count++;
    prev = present;
  }
  cout << count << endl;
  return 0;
}
