#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  string s;
  cin >> s;
  int a = 0, b = 1;
  for (int i = 0; i < int(s.size()); i++)
    if (s[i] == '1')
      a = min(a, b) + 1;
    else
      b = min(a, b) + 1;
  cout << a;
  return 0;
}
