#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  string s;
  cin >> s;
  m = s.size();
  n = m / 3;
  if (m % 3 == 0) {
    cout << 2 * n << endl;
  } else {
    cout << 2 * n + 1 << endl;
  }
}
