#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dbg(x) cerr << #x << " : " << x << endl;
int main(){
    string s;
    cin >> s;
    ll n=s.size();
    vector<vector<ll>> dp(n,vector<ll>(2));
    dp[n-1][0]=1;
    dp[n-1][1]=0;
    for(ll i=n-2;i>=0;i--){
        dp[i][0]=(s[i]==s[i+1]?dp[i+1][1]+1:dp[i+1][0]+1);
        if(i+2==n) dp[i][1]=1;
        else dp[i][1]=dp[i+2][0]+1;
    }
    cout << dp[0][0] << endl;
    return 0;
}#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dbg(x) cerr << #x << " : " << x << endl;
int main(){
    string s;
    cin >> s;
    ll n=s.size();
    vector<vector<ll>> dp(n,vector<ll>(2));
    dp[n-1][0]=1;
    dp[n-1][1]=0;
    for(ll i=n-2;i>=0;i--){
        dp[i][0]=(s[i]==s[i+1]?dp[i+1][1]+1:dp[i+1][0]+1);
        if(i+2==n) dp[i][1]=1;
        else dp[i][1]=dp[i+2][0]+1;
    }
    cout << dp[0][0] << endl;
    return 0;
}