#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
string s;
string si[N];
bool f = 0;
bool check(int deep) {
  if (si[deep] != si[deep - 1])
    return 1;
  else
    return 0;
}
void dfs(int n, int deep) {
  if (n == s.size()) {
    cout << deep - 1 << endl;
    f = 1;
    return;
  }
  for (int i = n; i < s.size() && !f; i++) {
    si[deep] = s.substr(n, i - n + 1);
    if (check(deep) && !f) {
      deep++;
      dfs(i + 1, deep);
    }
  }
}
int main() {
  cin >> s;
  dfs(0, 1);
  return 0;
}
