#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 6;
const long long inf = 1e18;
int n;
string s;
int dp[MAX];
int dfs(int i, string prev) {
  if (i + 1 >= n - 1) return 0;
  string t = "";
  for (int j = i + 1; j < s.size(); j++) {
    t = t + s[j];
    if (t != prev) return dfs(j, t) + 1;
  }
}
int main() {
  cin >> s;
  int k = 0;
  n = s.size();
  string now = "";
  now = now + s[n - 1];
  string t = "";
  cout << dfs(0, t);
}
