#include <bits/stdc++.h>
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename C>
std::ostream& _debug_go(std::ostream& os, const C& v) {
  bool first = true;
  os << "[";
  for (auto i : v) {
    if (!first) os << ", ";
    os << i;
    first = false;
  }
  return os << "]";
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  return _debug_go(os, v);
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
  return _debug_go(os, v);
}
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {
  return _debug_go(os, v);
}
struct Debugger {
  template <typename T>
  Debugger& operator,(const T& v) {
    std::cerr << v << " ";
    return *this;
  }
} dbg;
using namespace std;
using ui = uint32_t;
using ll = int64_t;
using ull = uint64_t;
template <typename T = int>
using Pt = complex<T>;
template <typename T>
T cross(const Pt<T>& a, const Pt<T>& b) {
  return a.real() * b.imag() - a.imag() * b.real();
}
template <typename T>
bool cmpPt(const Pt<T>& a, const Pt<T>& b) {
  return a.real() < b.real() || (a.real() == b.real() && a.imag() < b.imag());
}
constexpr int MAX_S = 2e5 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  static int DP[MAX_S][15];
  for (int i = (1); i < (int(S.size()) + 1); ++i)
    for (int k0 = (1); k0 < (min(i, 10) + 1); ++k0)
      for (int k1 = (0); k1 < (min(i - k0, 10) + 1); ++k1) {
        if (S.substr(i - k0, k0) == S.substr(i - k0 - k1, k1)) continue;
        DP[i][k0] = max(DP[i][k0], DP[i - k0][k1] + 1);
      }
  cout << *max_element(DP[S.size()], DP[S.size()] + 11) << '\n';
  return 0;
}
