#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    string s;
    cin >> s;
    ll n = SZ(s);
    ll i = 0;
    string tmp1; // prev
    string tmp2; // now
    ll ans1 = 0;
    bool f1 = 1;
    while(i < n){
        do{
            if(i >= n){
                f1 = 0;
            }
            tmp2 += s[i];
            i++;
        }while(tmp2 == tmp1);
        dump(tmp1, tmp2);
        tmp1 = tmp2;
        tmp2 = "";
        ans1++;
    }
    ll i = 2;
    string tmp1 = s.substr(0, 2); // prev
    string tmp2; // now
    ll ans2 = 0;
    bool f2 = 1;
    while(i < n){
        do{
            if(i >= n){
                f2 = 0;
            }
            tmp2 += s[i];
            i++;
        }while(tmp2 == tmp1);
        dump(tmp1, tmp2);
        tmp1 = tmp2;
        tmp2 = "";
        ans2++;
    }
    assert(!(f1 && f2 && ans1 != ans2));
    if(f1) cout << ans1 << endl;
    if(f2) cout << ans2 << endl;
    return 0;
}