#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using Graph = vector<vector<ll>>;
int main() {
  string s;
  cin >> s;
  ll n = s.size();
  if (n == 1)
    cout << 1 << endl;
  else {
    vec dp(30000);
    dp[0] = 1;
    if (s[0] == s[1])
      dp[1] = 1;
    else
      dp[1] = 2;
    if (n == 2)
      cout << dp[1] << endl;
    else {
      for (ll i = 0; i < n - 2; i++) {
        if (s[i] == s[i + 2])
          dp[i + 2] = dp[i] + 1;
        else
          dp[i + 2] = dp[i] + 2;
      }
      cout << dp[n - 1] << endl;
    }
  }
}
