#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int x = s.length();
  if (x % 2) {
    cout << ((x / 2) - 1) + (x / 2) << endl;
  } else {
    cout << ((x / 2) - 1) + ((x / 2) - 1) << endl;
  }
}
