#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int res = 0;
  for (int i = 0; i < S.length(); i++) {
    res++;
    int r = (S.length() - i) % 3;
    if (r == 0 || r == 2) {
      i++;
    }
  }
  cout << res << endl;
  return 0;
}
