#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long ans = 0LL;
  for (long long i = 0LL; i < s.size(); i += 3) {
    if (s[i] == s[(i + 1)]) {
      ans += 2;
    } else {
      ans += 3;
    }
  }
  cout << ans << endl;
}
