#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int M = 17 + 5;
const int W = 1000 + 5;
const int OO = 1e9;
const int mod = 1e9 + 7;
string second;
map<pair<int, string>, int> dp, vis;
int solve(int idx, string x) {
  if (idx == second.size()) return 0;
  int &ret = dp[make_pair(idx, second)];
  if (vis[make_pair(idx, second)]) return ret;
  ret = -OO;
  string c;
  c += second[idx];
  if (x != c) ret = max(ret, 1 + solve(idx + 1, c));
  if (idx < second.size() - 1) {
    c += second[idx + 1];
    if (x != c) ret = max(ret, 1 + solve(idx + 2, c));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> second;
  cout << solve(0, "") << '\n';
  return 0;
}
