#include <bits/stdc++.h>
using namespace std;
long long const MOD = 1e9 + 7;
int const inf = 1e9;
long long const INF = 1e18;
inline void ios_() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
template <typename T>
int size(const T& a) {
  return (int)a.size();
}
template <typename T>
T Div(T a, T b) {
  return (a + b - 1) / b;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  string s;
  cin >> s;
  int n = size(s);
  vector<string> v;
  for (int i = 0; 3 * i < n; i++) {
    string t = s.substr(3 * i, 3);
    v.push_back(t);
  }
  int ans = 0;
  for (int(i) = 0; (i) < (v.size()); (i)++) {
    if (v[i].size() == 3) {
      if (v[i][0] == v[i][1] || v[i][1] == v[i][2]) {
        ans += 2;
      } else {
        ans += 3;
      }
    } else if (v[i].size() == 2) {
      if (v[i][0] == v[i][1]) {
        ans += 1;
      } else {
        ans += 2;
      }
    } else {
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
