#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vvi = vector<vector<ll>>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod = 17 * 7 * (1 << 23) + 1;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    ans++;
    if (i && s[i] == s[i - 1]) i++;
  }
  cout << ans;
}
