#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int input() {
  long long int a;
  cin >> a;
  return a;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  pair<string, int> dp[200050];
  for (int i = 0; i < s.size(); i++) dp[i] = {"", 0};
  for (int i = 0; i < s.size(); i++) {
    string str;
    str += s[i];
    if (dp[i + 1].second < dp[i].second + 1 && dp[i].first != str)
      dp[i + 1] = {str, dp[i].second + 1};
    str += s[i + 1];
    if (dp[i + 2].second <= dp[i].second + 1 && dp[i].first != str &&
        i < s.size())
      dp[i + 2] = {str, dp[i].second + 1};
  }
  int ans = dp[s.size()].second;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) dp[i] = {"", 0};
  for (int i = 0; i < s.size(); i++) {
    string str;
    str += s[i];
    if (dp[i + 1].second < dp[i].second + 1 && dp[i].first != str)
      dp[i + 1] = {str, dp[i].second + 1};
    str += s[i + 1];
    if (dp[i + 2].second <= dp[i].second + 1 && dp[i].first != str &&
        i < s.size())
      dp[i + 2] = {str, dp[i].second + 1};
  }
  cout << max(dp[s.size()].second, ans) << endl;
}
