#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define forn(i, n) for (ll i = 0; i < (n); i++)
#define fori(i, b, e) for (ll i = (b); i < (e); i++)
#define forr(i, b, e) for (ll i = (b); i >= (e); i--)
#define allele(v) v.begin(), v.end()
#define fi first
#define se second
#define Mat vector<vector<ll>>
#define Arr vector<ll>
#define Matd vector<vector<ld>>
#define Arrd vector<ld>

typedef vector<vector<pair<ll, ll>>> Graph;
vector<ll> dp;
ll n, m, p;
bool dfs(Graph &G, int vert, int parent = -1)
{
    static vector<ll> col(n + 1, 0);
    static vector<ll> par(n + 1);
    bool res = false;
    col[vert] = 1;
    for (auto u : G[vert])
    {
        bool flag = (dp[vert] - p + u.se > dp[u.fi]);
        dp[u.fi] = max(dp[u.fi], (dp[vert] == (ll)5e11 ? (ll)5e11 : dp[vert] - p + u.se));
        if (col[u.fi] == 0)
        {
            par[u.fi] = vert;
            if (dfs(G, u.fi))
                res = true;
        }
        else if (col[u.fi] == 1)
        {
            ll cycle_end = vert;
            ll cycle_start = u.fi;
            if (flag)
            {
                vector<ll> cycle;
                cycle.push_back(cycle_start);
                for (ll v = cycle_end; v != cycle_start; v = par[v])
                    cycle.push_back(v);
                cycle.push_back(cycle_start);
                reverse(cycle.begin(), cycle.end());
                for (ll v : cycle)
                    dp[v] = 5e11;
            }
            res = true;
        }
    }
    col[vert] = 2;
    // if (res)
    // {
    for (auto u : G[vert])
        dp[u.fi] = 5e11;
    // }
    return res;
}
bool dfs2(Graph &G, int vert, int parent = -1)
{
    static vector<ll> col(n + 1, 0);
    static vector<ll> par(n + 1);
    bool res = false;
    col[vert] = 1;
    for (auto u : G[vert])
    {
        bool flag = (dp[vert] - p + u.se > dp[u.fi]);
        dp[u.fi] = max(dp[u.fi], (dp[vert] == (ll)5e11 ? (ll)5e11 : dp[vert] - p + u.se));
        if (col[u.fi] == 0 || col[u.fi] == 1)
        {
            par[u.fi] = vert;
            if (dfs(G, u.fi))
                res = true;
        }
        else if (col[u.fi] == 1)
        {
            // ll cycle_end = vert;
            // ll cycle_start = u.fi;
            // if (flag)
            // {
            //     vector<ll> cycle;
            //     cycle.push_back(cycle_start);
            //     for (ll v = cycle_end; v != cycle_start; v = par[v])
            //         cycle.push_back(v);
            //     cycle.push_back(cycle_start);
            //     reverse(cycle.begin(), cycle.end());
            //     for (ll v : cycle)
            //         dp[v] = 5e11;
            // }
            // res = true;
        }
    }
    col[vert] = 2;
    // if (res)
    // {
    for (auto u : G[vert])
        dp[u.fi] = 5e11;
    // }
    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    string prev = "", cur;
    cur = s[0];
    ll ans = 0;
    fori(i, 1, s.size())
    {
        if (cur == prev)
            cur += s[i];
        else
            ans++, prev = cur, cur = s[i];
    }
    cout << (ans + (prev != cur)) << endl;
    return 0;
}

Measured memory_bytes: 720