#include <bits/stdc++.h>
using namespace std;
static const int MAX = 2e5 + 6;
int main() {
  string s;
  cin >> s;
  set<string> unique;
  int n = s.length();
  int dp[n];
  for (int i = 0; i < n; i++) {
    dp[i] = 0;
  }
  dp[0] = 2;
  int dbl = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == s[i - 1]) {
      dbl += 1;
      if (dbl % 2 == 0) {
        dp[i] = dp[i - 1] + 1;
        dbl = 0;
      } else {
        dp[i] = dp[i - 1];
      }
    } else {
      dbl = 0;
      dp[i] = dp[i - 1] + 1;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
