#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
const ll MOD = 1000000007;
const ll MOD9 = 998244353;
const int inf = 1e9;
const ll INF = 4e18;
const ll dy[4] = {1, 0, -1, 0};
const ll dx[4] = {0, -1, 0, 1};
template <class t, class u>
void chmax(t& a, u b) {
  if (a < b) a = b;
}
template <class t, class u>
void chmin(t& a, u b) {
  if (b < a) a = b;
}
long long fac(ll a) {
  long long ans = 1;
  while (a > 1) {
    ans *= a;
    ans %= 1000000007;
    a--;
  }
  return ans;
}
int main() {
  string S;
  cin >> S;
  ll x = S.size();
  ll dp[x + 1];
  dp[0] = 0;
  dp[1] = 1;
  if (S.at(0) == S.at(1)) {
    dp[2] = 1;
  } else if (S.at(0) == S.at(1)) {
    dp[2] = 2;
  }
  if (x >= 3) {
    for (ll i = (2); i < (x); i++) {
      if (S.at(i - 1) != S.at(i)) {
        dp[i + 1] = dp[i] + 1;
        continue;
      } else if (S.at(i - 1) == S.at(i)) {
        dp[i + 1] = dp[i - 2] + 2;
      }
    }
    cout << dp[x] << endl;
  }
  if (x <= 2) {
    cout << dp[x] << endl;
  }
}
