#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int kol = 0;
  char t;
  int ans = 0;
  cin >> s;
  s += '0';
  int l = 0;
  for (int i = 0; i < s.length(); ++i) {
    t = s[l + 1];
    if (kol % 2 == 1) {
      (s[l] == '0') ? (s[l] = '1') : (s[l] = '0');
      (t == '0') ? (t = '1') : (t = '0');
    }
    if (s[l] == '1') {
      if (t == '1') {
        s[l] = '0';
        ++l;
        ++kol;
      } else {
        ++l;
      }
      ++ans;
    } else {
      ++l;
    }
  }
  cout << ans << endl;
  return 0;
}
