#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
long long dp[200010];
int main() {
  string s;
  cin >> s;
  int n = s.size();
  dp[1] = 1;
  dp[2] = 1;
  for (int i = 3; i <= n + 5; i++) {
    dp[i] = dp[i - dp[i - 1]] + dp[i - dp[i - 2]];
  }
  long long ans = 1;
  string prev = "";
  for (int i = 0; i < n; i++) {
    while (s[i] == s[i + 1]) i++;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
