//ans1 = x%3;
//ans1 == 0 | 1 | 2;

//if (ans1 == 0) {
//  count = (x/3)*2;
//}
//else
//  count = (x/3)*2+1;

//if ans1 == 0
//  count = (x/3)*2
//else if ans1 = 1
//  ans2 = (x/3)*2+1
//else if ans1 = 2
//  ans2 = (x/3)*2+1

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string x;
  cin >> x;
  int ans1 = x.size()%3;

  if (ans1 == 0)
    count = (x.size()/3)*2;
  else
    count = (x.size()/3)*2+1;
  
  cout << count << endl;
}
