#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int l = str.length();
  str = str.substr(1, l - 1);
  int flag = 0;
  if (str.find('1') != str.npos) flag = 1;
  if (flag == 1)
    cout << (l - 1) / 2 + 1;
  else
    cout << (l) / 2;
}
