//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
//#define int ll
#define xx first
#define yy second
#define pb push_back
#define all(x) begin(x), end(x)
#define OUT(x) { cout << x; exit(0); }
using namespace std;
typedef double db;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
const db eps = 1e-9;
const db pi = acos(-1.0);
const db dinf = 1e250;
const ll INF = (ll)(2e18);
const int inf = (int)(1e9 + 7);
//------------------------------------------//

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cout << fixed << setprecision(10);
    cin.tie(0);

#ifdef _MY
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    string s;
    cin >> s;
    int cnt = 0;

    string cur;
    vector<string> vs;
    vs.pb(s.substr(0, 1));
    for (int i = 1; i < size(s); ++i)
    {
        cur += s[i];
        if (cur != vs.back()) vs.pb(cur), cur = "";
    }
    if (cur.size() && cur != vs.back()) vs.pb(cur);

    cur = "";
    int res = vs.size();
    vs.clear();
    vs.pb(s.substr(0, 2));

    for (int i = 2; i < s.size(); ++i)
    {
        cur += s[i];
        if (cur != vs.back()) vs.pb(cur), cur = "";
    }
    if (cur.size() && cur != vs.back()) vs.pb(cur);


    res = max(res, (int)vs.size());
    cout << res;


    return 0;
}