#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
typedef long long ll;
typedef pair<int,int> P;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000009;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}

int main(){
  string s;
  char k=' ';
  cin>>s;
  int n=s.size();
  int i=0,ans=0;
  while(i<n){
    if(k!=s[i]){
      i++;
      k=s[i];
      ans++;
    }
    else{
      i+=2;
      k=' ';
      if(i<=n)ans++;
    }
  }
  cout<<ans<<endl;
}