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